Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow arbitrarily many glyphs and sprites to be used in a style #141

Closed
kkaefer opened this issue Oct 22, 2013 · 5 comments · Fixed by #5190
Closed

Allow arbitrarily many glyphs and sprites to be used in a style #141

kkaefer opened this issue Oct 22, 2013 · 5 comments · Fixed by #5190
Assignees
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏

Comments

@kkaefer
Copy link
Contributor

kkaefer commented Oct 22, 2013

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.

@mourner mourner added this to the future milestone Jun 24, 2014
@mourner mourner modified the milestones: future, post-v0.2.0 Aug 8, 2014
@mourner mourner modified the milestones: v0.3, v0.4 Aug 27, 2014
@jfirebaugh jfirebaugh modified the milestone: v0.4 Nov 4, 2014
@jfirebaugh jfirebaugh changed the title Handle glyph atlas overflow Handle glyph/sprite atlas overflow Jan 14, 2015
@ansis
Copy link
Contributor

ansis commented 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
Copy link
Contributor Author

kkaefer commented 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
Copy link
Contributor

ansis commented Jan 6, 2016

an example style that hit the sprite atlas limit because of large fill patterns: #1633

besides implementing resizing we could:

  • use separate textures for fill patterns (but this would break data driven fill patterns later on)
  • use a larger default size 1024x1024 instead of the current 512x512

@bhousel
Copy link
Contributor

bhousel commented Jan 6, 2016

Hey @ansis I have this mostly working in the glyph_overflow branch.. I'll finish it up and PR this week.

bensleveritt pushed a commit to bensleveritt/mapbox-gl-js that referenced this issue Oct 24, 2016
Hide internal events from end user and standardize external events
@lucaswoj
Copy link
Contributor

lucaswoj commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants