summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoozbeh Pournader <roozbeh@google.com>2017-10-13 17:41:31 -0700
committerRoozbeh Pournader <roozbeh@google.com>2017-10-17 09:19:48 -0700
commit7e04dd1859f51c77e5a24f79bcb909b91da48c4b (patch)
tree02dd53c39ac78e1fb64c001c124475c808a66c80
parentb52a5d3331d839fd1e3fc32b679ab78bae7a1317 (diff)
Enable patterns for Belarusian and Latin languages
The native frameworks code now knows about Belarusian and Latin patterns. Also, the fontchain_lint tool needed to know the script for any hyphenation patterns added, and now it does. Bug: 65626527 Test: make -j fontchain_lint Change-Id: I747cbb5ea3d36ca63335bfe6b337fad1e75ee79b
-rw-r--r--core/jni/android_text_Hyphenator.cpp2
-rwxr-xr-xtools/fonts/fontchain_lint.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/core/jni/android_text_Hyphenator.cpp b/core/jni/android_text_Hyphenator.cpp
index b46f38959d6b..05bec28a5d39 100644
--- a/core/jni/android_text_Hyphenator.cpp
+++ b/core/jni/android_text_Hyphenator.cpp
@@ -83,6 +83,7 @@ static void init() {
constexpr int INDIC_MIN_SUFFIX = 2;
addHyphenator("as", INDIC_MIN_PREFIX, INDIC_MIN_SUFFIX); // Assamese
+ addHyphenator("be", 2, 2); // Belarusian
addHyphenator("bg", 2, 2); // Bulgarian
addHyphenator("bn", INDIC_MIN_PREFIX, INDIC_MIN_SUFFIX); // Bengali
addHyphenator("cu", 1, 2); // Church Slavonic
@@ -106,6 +107,7 @@ static void init() {
// Going with a more conservative value of (2, 2) for now.
addHyphenator("hy", 2, 2); // Armenian
addHyphenator("kn", INDIC_MIN_PREFIX, INDIC_MIN_SUFFIX); // Kannada
+ addHyphenator("la", 2, 2); // Latin
addHyphenator("ml", INDIC_MIN_PREFIX, INDIC_MIN_SUFFIX); // Malayalam
addHyphenator("mn-Cyrl", 2, 2); // Mongolian in Cyrillic script
addHyphenator("mr", INDIC_MIN_PREFIX, INDIC_MIN_SUFFIX); // Marathi
diff --git a/tools/fonts/fontchain_lint.py b/tools/fonts/fontchain_lint.py
index c6ad4c2aa396..dcb90e411d34 100755
--- a/tools/fonts/fontchain_lint.py
+++ b/tools/fonts/fontchain_lint.py
@@ -13,6 +13,7 @@ EMOJI_VS = 0xFE0F
LANG_TO_SCRIPT = {
'as': 'Beng',
+ 'be': 'Cyrl',
'bg': 'Cyrl',
'bn': 'Beng',
'cu': 'Cyrl',
@@ -33,6 +34,7 @@ LANG_TO_SCRIPT = {
'ja': 'Jpan',
'kn': 'Knda',
'ko': 'Kore',
+ 'la': 'Latn',
'ml': 'Mlym',
'mn': 'Cyrl',
'mr': 'Deva',