You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow arbitrarily many glyphs and sprites to be used in a style #141
In areas that have a lot of distinct glyphs (e.g. Akihabara, Tokyo), we're pushing the limits of the glyph atlas because not all glyphs fit into one texture.
We're using a two bytes to store texture coordinates. With the current 1024 texture we round coordinates to the nearest 4px. For bigger textures either we need to use more space for texture coordinates or we need to round to 8px.
We could have multiple texture atlases and put glyphs in different buffers based on which atlas they are using. This could get annoying.
Or we could just make separate glyph atlases for each fontstack. This could give us enough breathing room to avoid implementing resizing.
Another optimization we could use is to optimize our font stacks. Contention for the texture space is only happening in areas with many glyphs, in particular Asian countries. However, in those areas, we're typically using either Arial Unicode MS or the Bold version thereof. Unfortunately, these are currently encoded as distinct glyphs for every font stack so that it's likely that we have the exact same glyph multiple times in our atlas.
Activity
[-]Handle glyph atlas overflow[/-][+]Handle glyph/sprite atlas overflow[/+]ansis commentedon May 2, 2015
We're using a two bytes to store texture coordinates. With the current 1024 texture we round coordinates to the nearest 4px. For bigger textures either we need to use more space for texture coordinates or we need to round to 8px.
We could have multiple texture atlases and put glyphs in different buffers based on which atlas they are using. This could get annoying.
Or we could just make separate glyph atlases for each fontstack. This could give us enough breathing room to avoid implementing resizing.
kkaefer commentedon May 2, 2015
Another optimization we could use is to optimize our font stacks. Contention for the texture space is only happening in areas with many glyphs, in particular Asian countries. However, in those areas, we're typically using either Arial Unicode MS or the Bold version thereof. Unfortunately, these are currently encoded as distinct glyphs for every font stack so that it's likely that we have the exact same glyph multiple times in our atlas.
ansis commentedon Jan 6, 2016
an example style that hit the sprite atlas limit because of large fill patterns: #1633
besides implementing resizing we could:
bhousel commentedon Jan 6, 2016
Hey @ansis I have this mostly working in the
glyph_overflowbranch.. I'll finish it up and PR this week.[-]Handle glyph/sprite atlas overflow[/-][+]Allow arbitrarily many glyphs and sprites to be used in a style[/+]Merge pull request mapbox#141 from mapbox/no-internal-events
lucaswoj commentedon Nov 14, 2016
The 🔥 need has been sufficiently doused by increasing the glyph atlas size that we can remove the high priority tag on this one.
Merge pull request #141 from mapbox/avoid-edges