A fontstack is an ordered list consisting of a primary font and optional fallback font(s).
Fonts can only be set on
symbol layer types. Set fonts from the Style tab of each
symbol layer, under Text, in the
Font input field. Each list of unique font pairings between primary and fallback font(s) will create a new fontstack.
An example fontstack:
'Roboto Black', 'Arial Unicode MS Bold';
When your primary font has missing glyphs, the text will be rendered in the fallback font instead. The default fallback font set by Mapbox Studio is
Arial Unicode MS Bold. Unicode fonts include more glyphs than conventional fonts, allowing for better multilingual coverage.
Manage rendering time
The number of fontstacks paired with the density of text per zoom on your map can significantly slow down your map’s load time, especially when using multilingual labels. This is because dense multilingual text, at any set zoom level, will increase rendering time.
Here are some tips to decrease your map’s rendering time:
- Latin scripts can handle more fontstacks, while other scripts like Chinese or Hangul, can require loading dozens of glyph tiles per fontstack.
- Keeping labels sparse and spread across zoom levels allows for more fontstacks in your map style.
- For multilingual maps with dense labeling, consider using fewer fontstacks.
Manage offline download size
When using one of our mobile SDKs, you can often reduce the amount of space required to download an offline region dramatically by limiting the number of fontstacks in your style. To learn more about reducing offline download sizes, please see our guide to offline maps.