diff options
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); |