Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Glyph bitmap overflow, disappearing labels on rotation #1681

Closed
1ec5 opened this issue Jun 3, 2015 · 8 comments
Closed

Glyph bitmap overflow, disappearing labels on rotation #1681

1ec5 opened this issue Jun 3, 2015 · 8 comments
Labels
bug Core The cross-platform C++ core, aka mbgl

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jun 3, 2015

With #1666 in iOS 8.3 on an iPhone 6, when rotating the map, I’m seeing CJK labels disappear instead of flipping vertically:

img_0291
img_0292
img_0293

Doesn’t reproduce in mapbox-gl-js (Emerald style) in Firefox 40.0a2 (2015-06-02).

/cc @ansis

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS labels Jun 3, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Jun 3, 2015

Although I wouldn’t discount the possibility that it has something to do with the corrupted glyph in that POI label in the center of the map.

@1ec5 1ec5 changed the title [new labeling] CJK labels disappear instead of flipping on rotation [new labeling] Labels disappear instead of flipping on rotation Jun 3, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Jun 3, 2015

I was also seeing the issue on Vietnamese labels (Latin with diacritics). But after restarting the app, I’m no longer seeing either the glyph corruption (completely misdrawn and flashing on every redraw) or the labels disappearing – the labels flip as expected. So it probably is related to the glyph corruption.

@1ec5 1ec5 changed the title [new labeling] Labels disappear instead of flipping on rotation [new labeling] Glyph corruption causes labels to disappear instead of flipping on rotation Jun 3, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Jun 3, 2015

When I do return to the problematic POI, I get lots of this in the console:

2015-06-03 11:09:20.093 TeaPod[10815:1731778] [ERROR] [OpenGL]: glyph bitmap overflow

@1ec5 1ec5 changed the title [new labeling] Glyph corruption causes labels to disappear instead of flipping on rotation [new labeling] Glyph bitmap overflow, disappearing labels on rotation Jun 3, 2015
@mikemorris
Copy link
Contributor

We've seen this with Chinese labels before (can't find the issue though), but we're essentially overstuffing the glyph atlas, because so many unique glyphs are needed and the glyphs are spread across so many "glyph tiles" (blocks of 256 codepoints). I think we're attempting to add all the bitmaps for a requested glyph tile to the atlas, even if only one or two glyphs in that block are actually needed for rendering at the moment (not happening this way anymore).

The sparse placement and long tail of less common glyphs across the Unicode range makes this a pretty difficult problem. Another possible compounding issue is that we're storing glyphs in the atlas by fontstack and codepoint, so there may be multiple copies of a glyph stored if multiple fontstacks share a common fallback.

I believe bin.allocate returns a zero-width Rect if it fails to allocate space in the atlas.

Refs mapbox/mapbox-gl-js#141

@jfirebaugh
Copy link
Contributor

We have several issues about sprite atlas overflow, but maybe not one about glyph atlas overflow specifically. However there is #1444, which is likely compounding the issue.

@1ec5 1ec5 changed the title [new labeling] Glyph bitmap overflow, disappearing labels on rotation Glyph bitmap overflow, disappearing labels on rotation Jun 4, 2015
@1ec5 1ec5 added Core The cross-platform C++ core, aka mbgl and removed iOS Mapbox Maps SDK for iOS labels Jul 12, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Jul 13, 2016

In case it wasn’t clear from the screenshots I took in #1681 (comment), this is what glyph overflow currently looks like:

glitch

It’s easy to reproduce this issue by panning around a city such as Tapei, in which many street names and POIs have Chinese names but not English names.

mapbox/mapbox-gl-js#141 is the equivalent bug in Mapbox GL JS.

This was referenced Aug 10, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Aug 17, 2016

What’s the state of this issue now that #5908 has landed? I’m unable to reproduce the issue anymore, though I haven’t tried very thoroughly. Do we still need this ticket around?

/cc @amyleew @xrwang

@amyleew
Copy link
Contributor

amyleew commented Aug 22, 2016

Haven't noticed it again @1ec5. Let's close for now, we can reopen if this becomes an issue in the future

@amyleew amyleew closed this as completed Aug 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

4 participants