Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Don't unnecessarily request glyphs for verticalized punctuation.
Browse files Browse the repository at this point in the history
Issue #8982.
  • Loading branch information
ChrisLoer committed May 18, 2017
1 parent eae2c71 commit cd4e679
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mbgl/layout/symbol_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,17 @@ SymbolLayout::SymbolLayout(const BucketParameters& parameters,
}

ft.text = applyArabicShaping(util::utf8_to_utf16::convert(u8string));
const bool canVerticalizeText = layout.get<TextRotationAlignment>() == AlignmentType::Map
&& layout.get<SymbolPlacement>() == 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<TextFont>()].insert(chr);
if (char16_t verticalChr = util::i18n::verticalizePunctuation(chr)) {
glyphDependencies[layout.get<TextFont>()].insert(verticalChr);
if (canVerticalizeText) {
if (char16_t verticalChr = util::i18n::verticalizePunctuation(chr)) {
glyphDependencies[layout.get<TextFont>()].insert(verticalChr);
}
}
}
}
Expand Down

0 comments on commit cd4e679

Please sign in to comment.