summaryrefslogtreecommitdiff
path: root/libs/minikin/Locale.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/minikin/Locale.h')
-rw-r--r--libs/minikin/Locale.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/minikin/Locale.h b/libs/minikin/Locale.h
index 285bb7b..a19daa9 100644
--- a/libs/minikin/Locale.h
+++ b/libs/minikin/Locale.h
@@ -123,6 +123,7 @@ public:
// Returns true if this script supports the given script. For example, ja-Jpan supports Hira,
// ja-Hira doesn't support Jpan.
bool supportsScript(uint32_t script) const;
+ bool supportsScript(char c1, char c2, char c3, char c4) const;
std::string getString() const;
@@ -217,6 +218,11 @@ public:
// The effective means the first non empty emoji style in the list.
EmojiStyle getEmojiStyle() const { return mEmojiStyle; }
+ bool atLeastOneScriptMatch(const LocaleList& list) const;
+
+ bool hasJapanese() const { return hasScript('J', 'p', 'a', 'n'); }
+ bool hasKorean() const { return hasScript('K', 'o', 'r', 'e'); }
+
private:
friend struct Locale; // for calcScoreFor
@@ -231,6 +237,8 @@ private:
uint8_t getUnionOfSubScriptBits() const { return mUnionOfSubScriptBits; }
bool isAllTheSameLocale() const { return mIsAllTheSameLocale; }
+ bool hasScript(char c1, char c2, char c3, char c4) const;
+
// Do not copy and assign.
LocaleList(const LocaleList&) = delete;
void operator=(const LocaleList&) = delete;