diff options
author | Chris Loer <chris.loer@gmail.com> | 2016-11-09 18:23:49 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-11-17 14:33:03 -0800 |
commit | 40b0c8d0760f8a767ef4646607ac63251d86de8d (patch) | |
tree | 5840c35c21dcb593198093769db8c81be6ce3674 /src/mbgl/text/glyph.hpp | |
parent | 5c7aeec5c7170f47a127391cfdb5e25b42ec8b58 (diff) | |
download | qtlocation-mapboxgl-40b0c8d0760f8a767ef4646607ac63251d86de8d.tar.gz |
[core] Use UTF-16 instead of UTF-32 for label features to avoid extra conversions and reduce in-memory size.
Continue to use uint32 as glyph ID to maintain Glyph PBF, even though we're only using 16 bits of that uint32.
Use std::codecvt instead of boost::unicode_iterator for UTF8->UTF16 conversions.
Diffstat (limited to 'src/mbgl/text/glyph.hpp')
-rw-r--r-- | src/mbgl/text/glyph.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp index a333f68ff4..d07fbdff21 100644 --- a/src/mbgl/text/glyph.hpp +++ b/src/mbgl/text/glyph.hpp @@ -11,7 +11,7 @@ namespace mbgl { // Note: this only works for the BMP -GlyphRange getGlyphRange(char32_t glyph); +GlyphRange getGlyphRange(char16_t glyph); struct GlyphMetrics { explicit operator bool() const { @@ -63,10 +63,10 @@ public: class Shaping { public: explicit Shaping() : top(0), bottom(0), left(0), right(0) {} - explicit Shaping(float x, float y, std::u32string text_) + explicit Shaping(float x, float y, std::u16string text_) : text(std::move(text_)), top(y), bottom(y), left(x), right(x) {} std::vector<PositionedGlyph> positionedGlyphs; - std::u32string text; + std::u16string text; int32_t top; int32_t bottom; int32_t left; |