Commit a5952d3049ff880bb8eea94f045b32575e59b58f

Werner Lemberg 2016-02-18T12:56:38

[autofit] Add blue-zone support for Malayalam script. This essentially moves the Malayalam script from the `Indic' hinter to the `Latin' hinter. * src/autofit/afblue.dat: Add blue zone data for Malayalam. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Malayalam standard characters and move data out of AF_CONFIG_OPTION_INDIC block. * src/autofit/afranges.c: Move Malayalam data out of AF_CONFIG_OPTION_INDIC block. * src/autofit/afstyles.h: Update Malayalam data; in particular, use AF_WRITING_SYSTEM_LATIN.

diff --git a/ChangeLog b/ChangeLog
index 66b28b1..ba8d492 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2016-02-18  Werner Lemberg  <wl@gnu.org>
+
+	[autofit] Add blue-zone support for Malayalam script.
+
+	This essentially moves the Malayalam script from the `Indic' hinter
+	to the `Latin' hinter.
+
+	* src/autofit/afblue.dat: Add blue zone data for Malayalam.
+
+	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+	* src/autofit/afscript.h: Add Malayalam standard characters and move
+	data out of AF_CONFIG_OPTION_INDIC block.
+
+	* src/autofit/afranges.c: Move Malayalam data out of
+	AF_CONFIG_OPTION_INDIC block.
+
+	* src/autofit/afstyles.h: Update Malayalam data; in particular, use
+	AF_WRITING_SYSTEM_LATIN.
+
 2016-02-16  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[smooth] Fix integer overflow (#47114).
diff --git a/src/autofit/afblue.c b/src/autofit/afblue.c
index 7d9646c..2e2397e 100644
--- a/src/autofit/afblue.c
+++ b/src/autofit/afblue.c
@@ -128,6 +128,10 @@
     '\0',
     '\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D',  /* ᵖ ʸ ᵍ */
     '\0',
+    '\xE0', '\xB4', '\x92', ' ', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xB1', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', ' ', '\xE0', '\xB4', '\x9A', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\xAA',  /* ഒ ട ഠ റ ച പ ച്ച പ്പ */
+    '\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', '\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',  /* င ဎ ဒ ပ ဗ ဝ ၊ ။ */
@@ -287,6 +291,9 @@
     { AF_BLUE_STRING_LATIN_SUPS_SMALL,           0                                 },
     { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0                                 },
     { AF_BLUE_STRING_MAX,                        0                                 },
+    { AF_BLUE_STRING_MALAYALAM_TOP,    AF_BLUE_PROPERTY_LATIN_TOP },
+    { AF_BLUE_STRING_MALAYALAM_BOTTOM, 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 9a7757c..b122498 100644
--- a/src/autofit/afblue.dat
+++ b/src/autofit/afblue.dat
@@ -200,6 +200,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
   AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER
     "ᵖ ʸ ᵍ"
 
+  AF_BLUE_STRING_MALAYALAM_TOP
+    "ഒ ട ഠ റ ച പ ച്ച പ്പ"
+  AF_BLUE_STRING_MALAYALAM_BOTTOM
+    "ട ഠ ധ ശ ഘ ച ഥ ല"
+
   AF_BLUE_STRING_MYANMAR_TOP
     "ခ ဂ င ဒ ဝ ၥ ၊ ။"
   AF_BLUE_STRING_MYANMAR_BOTTOM
@@ -504,6 +509,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
     { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0                                 }
     { AF_BLUE_STRING_MAX,                        0                                 }
 
+  AF_BLUE_STRINGSET_MLYM
+    { AF_BLUE_STRING_MALAYALAM_TOP,    AF_BLUE_PROPERTY_LATIN_TOP }
+    { AF_BLUE_STRING_MALAYALAM_BOTTOM, 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 75cd6c3..6fe460d 100644
--- a/src/autofit/afblue.h
+++ b/src/autofit/afblue.h
@@ -128,20 +128,22 @@ FT_BEGIN_HEADER
     AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 1146,
     AF_BLUE_STRING_LATIN_SUPS_SMALL = 1172,
     AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 1197,
-    AF_BLUE_STRING_MYANMAR_TOP = 1208,
-    AF_BLUE_STRING_MYANMAR_BOTTOM = 1240,
-    AF_BLUE_STRING_MYANMAR_ASCENDER = 1272,
-    AF_BLUE_STRING_MYANMAR_DESCENDER = 1300,
-    AF_BLUE_STRING_TELUGU_TOP = 1332,
-    AF_BLUE_STRING_TELUGU_BOTTOM = 1360,
-    AF_BLUE_STRING_THAI_TOP = 1388,
-    AF_BLUE_STRING_THAI_BOTTOM = 1412,
-    AF_BLUE_STRING_THAI_ASCENDER = 1440,
-    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1452,
-    AF_BLUE_STRING_THAI_DESCENDER = 1464,
-    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1480,
-    AF_BLUE_STRING_THAI_DIGIT_TOP = 1488,
-    af_blue_1_1 = 1499,
+    AF_BLUE_STRING_MALAYALAM_TOP = 1208,
+    AF_BLUE_STRING_MALAYALAM_BOTTOM = 1252,
+    AF_BLUE_STRING_MYANMAR_TOP = 1284,
+    AF_BLUE_STRING_MYANMAR_BOTTOM = 1316,
+    AF_BLUE_STRING_MYANMAR_ASCENDER = 1348,
+    AF_BLUE_STRING_MYANMAR_DESCENDER = 1376,
+    AF_BLUE_STRING_TELUGU_TOP = 1408,
+    AF_BLUE_STRING_TELUGU_BOTTOM = 1436,
+    AF_BLUE_STRING_THAI_TOP = 1464,
+    AF_BLUE_STRING_THAI_BOTTOM = 1488,
+    AF_BLUE_STRING_THAI_ASCENDER = 1516,
+    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1528,
+    AF_BLUE_STRING_THAI_DESCENDER = 1540,
+    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1556,
+    AF_BLUE_STRING_THAI_DIGIT_TOP = 1564,
+    af_blue_1_1 = 1575,
 #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,
@@ -213,10 +215,11 @@ FT_BEGIN_HEADER
     AF_BLUE_STRINGSET_LATN = 50,
     AF_BLUE_STRINGSET_LATB = 57,
     AF_BLUE_STRINGSET_LATP = 64,
-    AF_BLUE_STRINGSET_MYMR = 71,
-    AF_BLUE_STRINGSET_TELU = 76,
-    AF_BLUE_STRINGSET_THAI = 79,
-    af_blue_2_1 = 87,
+    AF_BLUE_STRINGSET_MLYM = 71,
+    AF_BLUE_STRINGSET_MYMR = 74,
+    AF_BLUE_STRINGSET_TELU = 79,
+    AF_BLUE_STRINGSET_THAI = 82,
+    af_blue_2_1 = 90,
 #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 4e81e78..a3fbb5a 100644
--- a/src/autofit/afranges.c
+++ b/src/autofit/afranges.c
@@ -354,6 +354,21 @@
   };
 
 
+  const AF_Script_UniRangeRec  af_mlym_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0D00UL,  0x0D7FUL ),  /* Malayalam */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_mlym_nonbase_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0D01UL,  0x0D01UL ),
+    AF_UNIRANGE_REC(  0x0D4DUL,  0x0D4EUL ),
+    AF_UNIRANGE_REC(  0x0D62UL,  0x0D63UL ),
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+
   const AF_Script_UniRangeRec  af_mymr_uniranges[] =
   {
     AF_UNIRANGE_REC( 0x1000UL, 0x109FUL ),    /* Myanmar            */
@@ -473,21 +488,6 @@
   };
 
 
-  const AF_Script_UniRangeRec  af_mlym_uniranges[] =
-  {
-    AF_UNIRANGE_REC(  0x0D00UL,  0x0D7FUL ),  /* Malayalam */
-    AF_UNIRANGE_REC(       0UL,       0UL )
-  };
-
-  const AF_Script_UniRangeRec  af_mlym_nonbase_uniranges[] =
-  {
-    AF_UNIRANGE_REC(  0x0D01UL,  0x0D01UL ),
-    AF_UNIRANGE_REC(  0x0D4DUL,  0x0D4EUL ),
-    AF_UNIRANGE_REC(  0x0D62UL,  0x0D63UL ),
-    AF_UNIRANGE_REC(       0UL,       0UL )
-  };
-
-
   const AF_Script_UniRangeRec  af_orya_uniranges[] =
   {
     AF_UNIRANGE_REC(  0x0B00UL,  0x0B7FUL ),  /* Oriya */
diff --git a/src/autofit/afscript.h b/src/autofit/afscript.h
index 9bbb6f3..aad1d22 100644
--- a/src/autofit/afscript.h
+++ b/src/autofit/afscript.h
@@ -111,6 +111,12 @@
           HINTING_BOTTOM_TO_TOP,
           "\xE1\xB5\x92 \xE1\xB4\xBC \xE2\x81\xB0" ) /* ᵒ ᴼ ⁰ */
 
+  SCRIPT( mlym, MLYM,
+          "Malayalam",
+          HB_SCRIPT_MALAYALAM,
+          HINTING_BOTTOM_TO_TOP,
+          "\xE0\xB4\xA0 \xE0\xB4\xB1" ) /* ഠ റ */
+
   SCRIPT( mymr, MYMR,
           "Myanmar",
           HB_SCRIPT_MYANMAR,
@@ -156,12 +162,6 @@
           HINTING_BOTTOM_TO_TOP,
           "o" ) /* XXX */
 
-  SCRIPT( mlym, MLYM,
-          "Malayalam",
-          HB_SCRIPT_MALAYALAM,
-          HINTING_BOTTOM_TO_TOP,
-          "o" ) /* XXX */
-
   SCRIPT( orya, ORYA,
           "Oriya",
           HB_SCRIPT_ORIYA,
diff --git a/src/autofit/afstyles.h b/src/autofit/afstyles.h
index 9c57258..32e0c1f 100644
--- a/src/autofit/afstyles.h
+++ b/src/autofit/afstyles.h
@@ -168,6 +168,13 @@
          AF_COVERAGE_DEFAULT )
 #endif
 
+  STYLE( mlym_dflt, MLYM_DFLT,
+         "Malayalam default style",
+         AF_WRITING_SYSTEM_LATIN,
+         AF_SCRIPT_MLYM,
+         AF_BLUE_STRINGSET_MLYM,
+         AF_COVERAGE_DEFAULT )
+
   STYLE( mymr_dflt, MYMR_DFLT,
          "Myanmar default style",
          AF_WRITING_SYSTEM_LATIN,
@@ -211,7 +218,6 @@
   STYLE_DEFAULT_INDIC( gujr, GUJR, "Gujarati" )
   STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" )
   STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" )
-  STYLE_DEFAULT_INDIC( mlym, MLYM, "Malayalam" )
   STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" )
   STYLE_DEFAULT_INDIC( sinh, SINH, "Sinhala" )
   STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" )