Commit dde03eec37579ef86ca6a9e04bf290bc85f785ad

Werner Lemberg 2019-03-19T10:50:38

[autofit] Add support for Mongolian script. As a de-facto standard, layouts using this script are constructed horizontally line by line, then the lines are rotated clockwise for vertical display. * src/autofit/afblue.dat: Add blue zone data for Mongolian. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Mongolian standard characters. * src/autofit/afranges.c, src/autofit/afstyles.h: Add Mongolian data.

diff --git a/ChangeLog b/ChangeLog
index 670e848..e8382f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2019-03-19  Werner Lemberg  <wl@gnu.org>
+
+	[autofit] Add support for Mongolian script.
+
+	As a de-facto standard, layouts using this script are constructed
+	horizontally line by line, then the lines are rotated clockwise for
+	vertical display.
+
+	* src/autofit/afblue.dat: Add blue zone data for Mongolian.
+	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+	* src/autofit/afscript.h: Add Mongolian standard characters.
+
+	* src/autofit/afranges.c, src/autofit/afstyles.h: Add Mongolian
+	data.
+
 2019-03-15  Werner Lemberg  <wl@gnu.org>
 
 	* Version 2.10.0 released.
diff --git a/src/autofit/afblue.c b/src/autofit/afblue.c
index 28da159..c90495a 100644
--- a/src/autofit/afblue.c
+++ b/src/autofit/afblue.c
@@ -296,6 +296,10 @@
     '\0',
     '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xA7', ' ', '\xE0', '\xB4', '\xB6', ' ', '\xE0', '\xB4', '\x98', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xA5', ' ', '\xE0', '\xB4', '\xB2',  /* ട ഠ ധ ശ ഘ ച ഥ ല */
     '\0',
+    '\xE1', '\xA0', '\xB3', ' ', '\xE1', '\xA0', '\xB4', ' ', '\xE1', '\xA0', '\xB6', ' ', '\xE1', '\xA0', '\xBD', ' ', '\xE1', '\xA1', '\x82', ' ', '\xE1', '\xA1', '\x8A', ' ', '\xE1', '\xA1', '\xA1', ' ', '\xE1', '\xA1', '\xB3',  /* ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ᡡ ᡳ */
+    '\0',
+    '\xE1', '\xA1', '\x83',  /* ᡃ */
+    '\0',
     '\xE1', '\x80', '\x81', ' ', '\xE1', '\x80', '\x82', ' ', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\xA5', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B',  /* ခ ဂ င ဒ ဝ ၥ ၊ ။ */
     '\0',
     '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x8E', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x95', ' ', '\xE1', '\x80', '\x97', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B',  /* င ဎ ဒ ပ ဗ ဝ ၊ ။ */
@@ -649,6 +653,9 @@
     { AF_BLUE_STRING_MALAYALAM_TOP,    AF_BLUE_PROPERTY_LATIN_TOP },
     { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0                          },
     { AF_BLUE_STRING_MAX,              0                          },
+    { AF_BLUE_STRING_MONGOLIAN_TOP_BASE,    AF_BLUE_PROPERTY_LATIN_TOP },
+    { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0                          },
+    { AF_BLUE_STRING_MAX,                   0                          },
     { AF_BLUE_STRING_MYANMAR_TOP,       AF_BLUE_PROPERTY_LATIN_TOP      |
                                         AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },
     { AF_BLUE_STRING_MYANMAR_BOTTOM,    0                                 },
diff --git a/src/autofit/afblue.dat b/src/autofit/afblue.dat
index 14a0993..cb58ce4 100644
--- a/src/autofit/afblue.dat
+++ b/src/autofit/afblue.dat
@@ -392,6 +392,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
   AF_BLUE_STRING_MALAYALAM_BOTTOM
     "ട ഠ ധ ശ ഘ ച ഥ ല"
 
+  AF_BLUE_STRING_MONGOLIAN_TOP_BASE
+    "ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ᡡ ᡳ"
+  AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE
+    "ᡃ"
+
   AF_BLUE_STRING_MYANMAR_TOP
     "ခ ဂ င ဒ ဝ ၥ ၊ ။"
   AF_BLUE_STRING_MYANMAR_BOTTOM
@@ -947,6 +952,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
     { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0                          }
     { AF_BLUE_STRING_MAX,              0                          }
 
+  AF_BLUE_STRINGSET_MONG
+    { AF_BLUE_STRING_MONGOLIAN_TOP_BASE,    AF_BLUE_PROPERTY_LATIN_TOP }
+    { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0                          }
+    { AF_BLUE_STRING_MAX,                   0                          }
+
   AF_BLUE_STRINGSET_MYMR
     { AF_BLUE_STRING_MYANMAR_TOP,       AF_BLUE_PROPERTY_LATIN_TOP      |
                                         AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
diff --git a/src/autofit/afblue.h b/src/autofit/afblue.h
index a2ff597..a013a97 100644
--- a/src/autofit/afblue.h
+++ b/src/autofit/afblue.h
@@ -212,56 +212,58 @@ FT_BEGIN_HEADER
     AF_BLUE_STRING_LISU_BOTTOM = 3506,
     AF_BLUE_STRING_MALAYALAM_TOP = 3538,
     AF_BLUE_STRING_MALAYALAM_BOTTOM = 3582,
-    AF_BLUE_STRING_MYANMAR_TOP = 3614,
-    AF_BLUE_STRING_MYANMAR_BOTTOM = 3646,
-    AF_BLUE_STRING_MYANMAR_ASCENDER = 3678,
-    AF_BLUE_STRING_MYANMAR_DESCENDER = 3706,
-    AF_BLUE_STRING_NKO_TOP = 3738,
-    AF_BLUE_STRING_NKO_BOTTOM = 3762,
-    AF_BLUE_STRING_NKO_SMALL_TOP = 3777,
-    AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3786,
-    AF_BLUE_STRING_OL_CHIKI = 3798,
-    AF_BLUE_STRING_OLD_TURKIC_TOP = 3822,
-    AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3837,
-    AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3857,
-    AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3897,
-    AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3927,
-    AF_BLUE_STRING_OSAGE_SMALL_TOP = 3942,
-    AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 3982,
-    AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4022,
-    AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4047,
-    AF_BLUE_STRING_OSMANYA_TOP = 4062,
-    AF_BLUE_STRING_OSMANYA_BOTTOM = 4102,
-    AF_BLUE_STRING_SAURASHTRA_TOP = 4142,
-    AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4174,
-    AF_BLUE_STRING_SHAVIAN_TOP = 4194,
-    AF_BLUE_STRING_SHAVIAN_BOTTOM = 4204,
-    AF_BLUE_STRING_SHAVIAN_DESCENDER = 4229,
-    AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4239,
-    AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4274,
-    AF_BLUE_STRING_SINHALA_TOP = 4289,
-    AF_BLUE_STRING_SINHALA_BOTTOM = 4321,
-    AF_BLUE_STRING_SINHALA_DESCENDER = 4353,
-    AF_BLUE_STRING_SUNDANESE_TOP = 4397,
-    AF_BLUE_STRING_SUNDANESE_BOTTOM = 4421,
-    AF_BLUE_STRING_SUNDANESE_DESCENDER = 4453,
-    AF_BLUE_STRING_TAI_VIET_TOP = 4461,
-    AF_BLUE_STRING_TAI_VIET_BOTTOM = 4481,
-    AF_BLUE_STRING_TAMIL_TOP = 4493,
-    AF_BLUE_STRING_TAMIL_BOTTOM = 4525,
-    AF_BLUE_STRING_TELUGU_TOP = 4557,
-    AF_BLUE_STRING_TELUGU_BOTTOM = 4585,
-    AF_BLUE_STRING_THAI_TOP = 4613,
-    AF_BLUE_STRING_THAI_BOTTOM = 4637,
-    AF_BLUE_STRING_THAI_ASCENDER = 4665,
-    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4677,
-    AF_BLUE_STRING_THAI_DESCENDER = 4689,
-    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4705,
-    AF_BLUE_STRING_THAI_DIGIT_TOP = 4713,
-    AF_BLUE_STRING_TIFINAGH = 4725,
-    AF_BLUE_STRING_VAI_TOP = 4757,
-    AF_BLUE_STRING_VAI_BOTTOM = 4789,
-    af_blue_1_1 = 4820,
+    AF_BLUE_STRING_MONGOLIAN_TOP_BASE = 3614,
+    AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE = 3646,
+    AF_BLUE_STRING_MYANMAR_TOP = 3650,
+    AF_BLUE_STRING_MYANMAR_BOTTOM = 3682,
+    AF_BLUE_STRING_MYANMAR_ASCENDER = 3714,
+    AF_BLUE_STRING_MYANMAR_DESCENDER = 3742,
+    AF_BLUE_STRING_NKO_TOP = 3774,
+    AF_BLUE_STRING_NKO_BOTTOM = 3798,
+    AF_BLUE_STRING_NKO_SMALL_TOP = 3813,
+    AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3822,
+    AF_BLUE_STRING_OL_CHIKI = 3834,
+    AF_BLUE_STRING_OLD_TURKIC_TOP = 3858,
+    AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3873,
+    AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3893,
+    AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3933,
+    AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3963,
+    AF_BLUE_STRING_OSAGE_SMALL_TOP = 3978,
+    AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 4018,
+    AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4058,
+    AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4083,
+    AF_BLUE_STRING_OSMANYA_TOP = 4098,
+    AF_BLUE_STRING_OSMANYA_BOTTOM = 4138,
+    AF_BLUE_STRING_SAURASHTRA_TOP = 4178,
+    AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4210,
+    AF_BLUE_STRING_SHAVIAN_TOP = 4230,
+    AF_BLUE_STRING_SHAVIAN_BOTTOM = 4240,
+    AF_BLUE_STRING_SHAVIAN_DESCENDER = 4265,
+    AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4275,
+    AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4310,
+    AF_BLUE_STRING_SINHALA_TOP = 4325,
+    AF_BLUE_STRING_SINHALA_BOTTOM = 4357,
+    AF_BLUE_STRING_SINHALA_DESCENDER = 4389,
+    AF_BLUE_STRING_SUNDANESE_TOP = 4433,
+    AF_BLUE_STRING_SUNDANESE_BOTTOM = 4457,
+    AF_BLUE_STRING_SUNDANESE_DESCENDER = 4489,
+    AF_BLUE_STRING_TAI_VIET_TOP = 4497,
+    AF_BLUE_STRING_TAI_VIET_BOTTOM = 4517,
+    AF_BLUE_STRING_TAMIL_TOP = 4529,
+    AF_BLUE_STRING_TAMIL_BOTTOM = 4561,
+    AF_BLUE_STRING_TELUGU_TOP = 4593,
+    AF_BLUE_STRING_TELUGU_BOTTOM = 4621,
+    AF_BLUE_STRING_THAI_TOP = 4649,
+    AF_BLUE_STRING_THAI_BOTTOM = 4673,
+    AF_BLUE_STRING_THAI_ASCENDER = 4701,
+    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4713,
+    AF_BLUE_STRING_THAI_DESCENDER = 4725,
+    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4741,
+    AF_BLUE_STRING_THAI_DIGIT_TOP = 4749,
+    AF_BLUE_STRING_TIFINAGH = 4761,
+    AF_BLUE_STRING_VAI_TOP = 4793,
+    AF_BLUE_STRING_VAI_BOTTOM = 4825,
+    af_blue_1_1 = 4856,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
     AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203,
@@ -355,24 +357,25 @@ FT_BEGIN_HEADER
     AF_BLUE_STRINGSET_LATP = 166,
     AF_BLUE_STRINGSET_LISU = 173,
     AF_BLUE_STRINGSET_MLYM = 176,
-    AF_BLUE_STRINGSET_MYMR = 179,
-    AF_BLUE_STRINGSET_NKOO = 184,
-    AF_BLUE_STRINGSET_NONE = 189,
-    AF_BLUE_STRINGSET_OLCK = 190,
-    AF_BLUE_STRINGSET_ORKH = 193,
-    AF_BLUE_STRINGSET_OSGE = 196,
-    AF_BLUE_STRINGSET_OSMA = 204,
-    AF_BLUE_STRINGSET_SAUR = 207,
-    AF_BLUE_STRINGSET_SHAW = 210,
-    AF_BLUE_STRINGSET_SINH = 216,
-    AF_BLUE_STRINGSET_SUND = 220,
-    AF_BLUE_STRINGSET_TAML = 224,
-    AF_BLUE_STRINGSET_TAVT = 227,
-    AF_BLUE_STRINGSET_TELU = 230,
-    AF_BLUE_STRINGSET_TFNG = 233,
-    AF_BLUE_STRINGSET_THAI = 236,
-    AF_BLUE_STRINGSET_VAII = 244,
-    af_blue_2_1 = 247,
+    AF_BLUE_STRINGSET_MONG = 179,
+    AF_BLUE_STRINGSET_MYMR = 182,
+    AF_BLUE_STRINGSET_NKOO = 187,
+    AF_BLUE_STRINGSET_NONE = 192,
+    AF_BLUE_STRINGSET_OLCK = 193,
+    AF_BLUE_STRINGSET_ORKH = 196,
+    AF_BLUE_STRINGSET_OSGE = 199,
+    AF_BLUE_STRINGSET_OSMA = 207,
+    AF_BLUE_STRINGSET_SAUR = 210,
+    AF_BLUE_STRINGSET_SHAW = 213,
+    AF_BLUE_STRINGSET_SINH = 219,
+    AF_BLUE_STRINGSET_SUND = 223,
+    AF_BLUE_STRINGSET_TAML = 227,
+    AF_BLUE_STRINGSET_TAVT = 230,
+    AF_BLUE_STRINGSET_TELU = 233,
+    AF_BLUE_STRINGSET_TFNG = 236,
+    AF_BLUE_STRINGSET_THAI = 239,
+    AF_BLUE_STRINGSET_VAII = 247,
+    af_blue_2_1 = 250,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
     af_blue_2_1_1 = af_blue_2_1 + 2,
diff --git a/src/autofit/afranges.c b/src/autofit/afranges.c
index c0dba81..45c8bbf 100644
--- a/src/autofit/afranges.c
+++ b/src/autofit/afranges.c
@@ -664,6 +664,21 @@
   };
 
 
+  const AF_Script_UniRangeRec  af_mong_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x1800,  0x18AF ),  /* Mongolian            */
+    AF_UNIRANGE_REC( 0x11660, 0x1167F ),  /* Mongolian Supplement */
+    AF_UNIRANGE_REC(       0,       0 )
+  };
+
+  const AF_Script_UniRangeRec  af_mong_nonbase_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x1885,  0x1886 ),
+    AF_UNIRANGE_REC(  0x18A9,  0x18A9 ),
+    AF_UNIRANGE_REC(       0,       0 )
+  };
+
+
   const AF_Script_UniRangeRec  af_mymr_uniranges[] =
   {
     AF_UNIRANGE_REC(  0x1000,  0x109F ),    /* Myanmar            */
diff --git a/src/autofit/afscript.h b/src/autofit/afscript.h
index c2f0c7a..2da8c70 100644
--- a/src/autofit/afscript.h
+++ b/src/autofit/afscript.h
@@ -243,6 +243,12 @@
           HINTING_BOTTOM_TO_TOP,
           "\xE0\xB4\xA0 \xE0\xB4\xB1" ) /* ഠ റ */
 
+  SCRIPT( mong, MONG,
+          "Mongolian",
+          HB_SCRIPT_MONGOLIAN,
+          HINTING_TOP_TO_BOTTOM,
+          "\xE1\xA1\x82 \xE1\xA0\xAA" ) /* ᡂ ᠪ */
+
   SCRIPT( mymr, MYMR,
           "Myanmar",
           HB_SCRIPT_MYANMAR,
diff --git a/src/autofit/afstyles.h b/src/autofit/afstyles.h
index edf4f54..8d1d708 100644
--- a/src/autofit/afstyles.h
+++ b/src/autofit/afstyles.h
@@ -322,6 +322,13 @@
          AF_BLUE_STRINGSET_MLYM,
          AF_COVERAGE_DEFAULT )
 
+  STYLE( mong_dflt, MONG_DFLT,
+         "Mongolian default style",
+         AF_WRITING_SYSTEM_LATIN,
+         AF_SCRIPT_MONG,
+         AF_BLUE_STRINGSET_MONG,
+         AF_COVERAGE_DEFAULT )
+
   STYLE( mymr_dflt, MYMR_DFLT,
          "Myanmar default style",
          AF_WRITING_SYSTEM_LATIN,