diff options
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/text/shaping.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/text/tagged_string.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/util/i18n.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/util/i18n.hpp | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp index d6cbb2a4f8..6d10085ad3 100644 --- a/src/mbgl/text/shaping.cpp +++ b/src/mbgl/text/shaping.cpp @@ -4,8 +4,6 @@ #include <mbgl/math/minmax.hpp> #include <mbgl/text/bidi.hpp> -#include <boost/algorithm/string.hpp> - #include <algorithm> #include <cmath> @@ -247,7 +245,7 @@ std::set<std::size_t> determineLineBreaks(const TaggedString& logicalInput, continue; } auto it = glyphs->second.find(codePoint); - if (it != glyphs->second.end() && it->second && !boost::algorithm::is_any_of(u" \t\n\v\f\r")(codePoint)) { + if (it != glyphs->second.end() && it->second && !util::i18n::isWhitespace(codePoint)) { currentX += (*it->second)->metrics.advance * section.scale + spacing; } diff --git a/src/mbgl/text/tagged_string.cpp b/src/mbgl/text/tagged_string.cpp index e199a7c962..851e011c4f 100644 --- a/src/mbgl/text/tagged_string.cpp +++ b/src/mbgl/text/tagged_string.cpp @@ -1,8 +1,6 @@ #include <mbgl/text/tagged_string.hpp> #include <mbgl/util/i18n.hpp> -#include <boost/algorithm/string.hpp> - namespace mbgl { void TaggedString::addSection(const std::u16string& sectionText, double scale, FontStackHash fontStack) { @@ -12,7 +10,6 @@ void TaggedString::addSection(const std::u16string& sectionText, double scale, F } void TaggedString::trim() { - auto whiteSpace = boost::algorithm::is_any_of(u" \t\n\v\f\r"); std::size_t beginningWhitespace = styledText.first.find_first_not_of(u" \t\n\v\f\r"); if (beginningWhitespace == std::u16string::npos) { // Entirely whitespace diff --git a/src/mbgl/util/i18n.cpp b/src/mbgl/util/i18n.cpp index 0fa6122673..66c9e027a7 100644 --- a/src/mbgl/util/i18n.cpp +++ b/src/mbgl/util/i18n.cpp @@ -618,6 +618,10 @@ bool isStringInSupportedScript(const std::string& input) { return true; } +bool isWhitespace(char16_t chr) { + return chr == u' ' || chr == u'\t' || chr == u'\n' || chr == u'\v' || chr == u'\f' || chr == u'\r'; +} + } // namespace i18n } // namespace util } // namespace mbgl diff --git a/src/mbgl/util/i18n.hpp b/src/mbgl/util/i18n.hpp index a74215a134..c7544f443b 100644 --- a/src/mbgl/util/i18n.hpp +++ b/src/mbgl/util/i18n.hpp @@ -75,6 +75,8 @@ char16_t verticalizePunctuation(char16_t chr); bool isStringInSupportedScript(const std::string& input); +bool isWhitespace(char16_t chr); + } // namespace i18n } // namespace util } // namespace mbgl |