From 4c5aff43b4fd5ed42a71b337725a6f4fa56f9bab Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Wed, 17 May 2017 16:48:06 -0700 Subject: [PATCH] [core] Don't unnecessarily request glyphs for verticalized punctuation. Issue #8982. --- src/mbgl/layout/symbol_layout.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index 0e8b2fa6360..bfe1db7a733 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -136,12 +136,17 @@ SymbolLayout::SymbolLayout(const BucketParameters& parameters, } ft.text = applyArabicShaping(util::utf8_to_utf16::convert(u8string)); + const bool canVerticalizeText = layout.get() == AlignmentType::Map + && layout.get() == SymbolPlacementType::Line + && util::i18n::allowsVerticalWritingMode(*ft.text); // Loop through all characters of this text and collect unique codepoints. for (char16_t chr : *ft.text) { glyphDependencies[layout.get()].insert(chr); - if (char16_t verticalChr = util::i18n::verticalizePunctuation(chr)) { - glyphDependencies[layout.get()].insert(verticalChr); + if (canVerticalizeText) { + if (char16_t verticalChr = util::i18n::verticalizePunctuation(chr)) { + glyphDependencies[layout.get()].insert(verticalChr); + } } } }