diff options
Diffstat (limited to 'src/mbgl/text/glyph.cpp')
-rw-r--r-- | src/mbgl/text/glyph.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mbgl/text/glyph.cpp b/src/mbgl/text/glyph.cpp new file mode 100644 index 0000000000..f02c710db2 --- /dev/null +++ b/src/mbgl/text/glyph.cpp @@ -0,0 +1,14 @@ +#include <mbgl/text/glyph.hpp> + +namespace mbgl { + +// Note: this only works for the BMP +GlyphRange getGlyphRange(char32_t glyph) { + unsigned start = (glyph/256) * 256; + unsigned end = (start + 255); + if (start > 65280) start = 65280; + if (end > 65533) end = 65533; + return { start, end }; +} + +} |