Files
MapLibreParticleLab/src/mbgl/text/glyph.cpp
Chris Loer 5cdf838a38 [core] De-mutex GlyphAtlas and SpriteAtlas
- Expose glyph and icon information to workers via message interface.
 - Glyph/SpriteAtlas track which tiles have outstanding requests
    and send messages to them when glyphs/icons become available.
 - Remove obsolete "updateSymbolDependentTiles" pathway
 - Symbol preparation for a tile now depends on all glyphs becoming
    available before it can start.
 - Start tracking individual icons needed for a tile, although we don't
    do anything with the information yet.
 - Introduce typedef for GlyphID
2017-04-04 11:33:12 -07:00

15 lines
325 B
C++

#include <mbgl/text/glyph.hpp>
namespace mbgl {
// Note: this only works for the BMP
GlyphRange getGlyphRange(GlyphID glyph) {
unsigned start = (glyph/256) * 256;
unsigned end = (start + 255);
if (start > 65280) start = 65280;
if (end > 65535) end = 65535;
return { start, end };
}
} // namespace mbgl