diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-11-27 12:50:28 -0800 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-12-18 12:17:22 -0800 |
commit | f1f2ebb019980d4c53d563d3495e016d50e23945 (patch) | |
tree | 62dd4a29a1e2c4680d59713cc2f6d101a1dab22b /src/mbgl/util | |
parent | a53818a10b821218b86478e048a3884db93f7c00 (diff) | |
download | qtlocation-mapboxgl-f1f2ebb019980d4c53d563d3495e016d50e23945.tar.gz |
[core] Hook LocalGlyphRasterizer "font family" configuration up to Renderer
Diffstat (limited to 'src/mbgl/util')
-rw-r--r-- | src/mbgl/util/i18n.cpp | 5 | ||||
-rw-r--r-- | src/mbgl/util/i18n.hpp | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mbgl/util/i18n.cpp b/src/mbgl/util/i18n.cpp index 3e3a68e248..1fc13bfb7d 100644 --- a/src/mbgl/util/i18n.cpp +++ b/src/mbgl/util/i18n.cpp @@ -392,6 +392,11 @@ bool allowsIdeographicBreaking(char16_t chr) { // || isInCJKCompatibilityIdeographsSupplement(chr)); } +bool allowsFixedWidthGlyphGeneration(char16_t chr) { + // Mirrors conservative set of characters used in glyph_manager.js/_tinySDF + return isInCJKUnifiedIdeographs(chr) || isInHangulSyllables(chr); +} + bool allowsVerticalWritingMode(const std::u16string& string) { for (char32_t chr : string) { if (hasUprightVerticalOrientation(chr)) { diff --git a/src/mbgl/util/i18n.hpp b/src/mbgl/util/i18n.hpp index 61c5a1ea96..b3960c743c 100644 --- a/src/mbgl/util/i18n.hpp +++ b/src/mbgl/util/i18n.hpp @@ -23,6 +23,10 @@ bool allowsIdeographicBreaking(const std::u16string& string); by the given Unicode codepoint due to ideographic breaking. */ bool allowsIdeographicBreaking(char16_t chr); +/** Conservative set of characters expected to have relatively fixed sizes and + advances */ +bool allowsFixedWidthGlyphGeneration(char16_t chr); + /** Returns whether any substring of the given string can be drawn as vertical text with upright glyphs. */ bool allowsVerticalWritingMode(const std::u16string& string); |