summaryrefslogtreecommitdiff
path: root/src/mbgl/text/tagged_string.cpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-06-07 15:38:08 +0300
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-08-13 13:32:56 +0300
commit9aa529576f4d0565bb81369f03a1fecdb8dd0886 (patch)
tree22c66df95c47aa8ad7f1e76ba4497adcb471a892 /src/mbgl/text/tagged_string.cpp
parent075d458403ba2c7367f06e5fc66c2a00c788634a (diff)
downloadqtlocation-mapboxgl-9aa529576f4d0565bb81369f03a1fecdb8dd0886.tar.gz
[core] Implement support for "text-writing-mode" layout property
Diffstat (limited to 'src/mbgl/text/tagged_string.cpp')
-rw-r--r--src/mbgl/text/tagged_string.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mbgl/text/tagged_string.cpp b/src/mbgl/text/tagged_string.cpp
index 8c4e3b02e8..e8a1c6f51f 100644
--- a/src/mbgl/text/tagged_string.cpp
+++ b/src/mbgl/text/tagged_string.cpp
@@ -8,6 +8,7 @@ void TaggedString::addSection(const std::u16string& sectionText, double scale, F
styledText.first += sectionText;
sections.emplace_back(scale, fontStack, std::move(textColor));
styledText.second.resize(styledText.first.size(), sections.size() - 1);
+ supportsVerticalWritingMode = nullopt;
}
void TaggedString::trim() {
@@ -37,4 +38,11 @@ void TaggedString::verticalizePunctuation() {
styledText.first = util::i18n::verticalizePunctuation(styledText.first);
}
+bool TaggedString::allowsVerticalWritingMode() {
+ if (!supportsVerticalWritingMode) {
+ supportsVerticalWritingMode = util::i18n::allowsVerticalWritingMode(rawText());
+ }
+ return *supportsVerticalWritingMode;
+}
+
} // namespace mbgl