blob: 7dea7246d7a3f143577a9bbaf2f7fa36cdb0bf9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <mbgl/text/glyph.hpp>
namespace mbgl {
// Note: this only works for the BMP
// Note: we could use a binary lookup table to get averaged constant time lookups, however,
// most of our lookups are going to be within the first 3 ranges listed here, so this is
// likely faster.
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 };
}
}
|