The style's font
A style can carry its own font for its labels: a TTF or OTF file stored inside the style, like an image, so it goes wherever the style goes. Add it in Settings › Typography.
The font is one font for the whole style, in up to three faces: regular, bold and italic. Every label uses it, place names, road names, POI names and the labels of your own data, in the face its layer's Text Style asks for. There is no font per layer. A face the style does not have is drawn in the map's built-in font.
Step by step
Give the style your own font
- Open Settings in the top bar and scroll to Typography.
- Drop the font's regular TTF or OTF file on the Regular drop zone ("Drop a TTF or OTF here, or browse…"), or click it to choose the file.
- The labels whose Text Style is normal change to the font, and a notice confirms it: "Style font loaded — Regular face · 28 KB". A font of a few hundred KB is on the map at once; for a file over 1 MB a notice says "Loading the style font…" first, while the map engine reads it, which for a font of tens of MB takes several seconds, and the page waits with it. The slot shows the font's name, its face, its size and how many characters it has, for example "Poppins" and "Regular · 10 KB · 106 characters".
- Labels whose Text Style is bold or italic keep the built-in bold or italic until you add the font's bold and italic files to Bold and Italic the same way.
To add a whole family at once, drop its files together on any empty slot: each file goes to the slot it names itself as, Regular, Bold or Italic. A single file goes to the slot you drop it on.
Go back to the built-in font
Click the × on each slot that holds a file. One Ctrl+Z brings back the last one removed.
The three faces
Each slot holds one face of the font, and a label uses the face its layer's Text Style asks for: Regular for normal text, Bold for bold, Italic for italic.
All three are optional, and each works on its own, so add only the faces you want. A label whose face is not in the style keeps the map's built-in font: with only a Bold face, bold labels use your font and everything else stays as it was. The Text preview in the Properties column shows which face the selected layer gets.
Replace puts another file in a slot; × removes it. Adding, replacing and removing a face are each one step in the history, so Ctrl+Z undoes them (see History).
Which files are accepted
| Accepted | Not accepted |
|---|---|
| TTF and OTF files, of any size | WOFF and WOFF2 web fonts, font collections (.ttc), and damaged files |
There is no size limit, but size has a cost, so choose the smallest file that covers the scripts your labels need. A font for Latin, Cyrillic and Greek is usually 200 to 400 KB; one that covers Chinese, Japanese or Korean is often 10 MB or more. The file is stored in the style, so every save, every reload and every download carries it, and the map engine reads the whole file each time the font is added or the style is opened, which for a font over 1 MB happens behind a "Loading the style font…" notice and for a very large one takes several seconds. Editing the style afterwards is not slowed by the font: the engine keeps it and reads it again only when a face changes. If you need only a part of a large font, a subsetting tool can cut it down to the characters you use.
A web font is refused with "… is a WOFF2 web font; the map needs the TTF or OTF file." Use the TTF or OTF file the web font was made from; font sites usually offer it as a desktop download.
Before a file goes into the style, Studio checks that the browser can read it. A file whose letter shapes cannot be read is refused with "… is damaged: its letter shapes cannot be read, so labels would be blank on the map."
When the font could not be applied
If the map refuses a face the browser accepted, a notice says "The style's font was not applied" with what to do, for example "The map could not load it as a font. Try a different TTF or OTF file." The style keeps the file; the labels stay in the built-in font until you replace or remove it in Settings › Typography.
Characters the font does not have
A label character the font does not have is drawn in the map's built-in font. A font with only Latin letters still shows Беларусь, Ελλάδα or 東京, in the built-in font, next to the Latin names in yours. The number of characters in the slot tells you how much a font covers.
Licences
The font file travels inside the style to every app that loads it, so check that the font's licence allows that before you add it. Fonts under the SIL Open Font License can be used this way.
Studio reads the licence text in the file. When it says the font is for personal or demo use, the slot shows "This font's licence looks limited to personal or demo use. Check that you may use it in a map you publish." The font still works; the warning stays under the slot for as long as the font is in the style.
A damaged font in a style
A style opened from a file, or edited outside Studio, can carry a font that is damaged. Its labels are blank on the map, so Studio says so twice:
- a notice, "The style's regular font is damaged";
- under the slot, in red: "This font is damaged: its letter shapes cannot be read, so labels that use it are blank on the map. Replace it with a working copy of the file, or remove it."
Use Replace with a working copy of the font, or × to go back to the built-in font.
Where else the font shows
- The Text preview in the Properties column draws the label in the face of the style's font that the layer uses, and names it: "Style font: Poppins — change in Settings". It reads "Style font: built-in" when the style has no font, and adds "(the style has no bold face)" when the style has a font but not the face this layer needs. change in Settings opens Typography. See Text.
- Sources in the top bar: the summary line ends with "font (1 face)", or the number of faces.
- Downloads: the font is in the
.stylefile and in Style (JSON) (see Download and use in your app). In the JSON it isfonts_section(see Fonts).
See also: The image library · Settings · Errors and troubleshooting