shithub: freetype+ttf2subf

Download patch

ref: 5c7646d22619bdf4f98acbc2585f41a75f8d0b23
parent: f216947813ab537e171897dee46c00cbfc22ed8a
author: Werner Lemberg <[email protected]>
date: Mon Feb 29 04:12:35 EST 2016

[autofit] Add blue-zone support for Sinhala script.

This essentially moves the Sinhala script from the `Indic' hinter to
the `Latin' hinter.

* src/autofit/afblue.dat: Add blue zone data for Sinhala.

* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/afscript.h: Add Sinhala standard character and move data
out of AF_CONFIG_OPTION_INDIC block.

* src/autofit/afranges.c: Move Sinhala data out of
AF_CONFIG_OPTION_INDIC block.

* src/autofit/afstyles.h: Update Sinhala data; in particular, use
AF_WRITING_SYSTEM_LATIN.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2016-02-29  Werner Lemberg  <[email protected]>
+
+	[autofit] Add blue-zone support for Sinhala script.
+
+	This essentially moves the Sinhala script from the `Indic' hinter to
+	the `Latin' hinter.
+
+	* src/autofit/afblue.dat: Add blue zone data for Sinhala.
+
+	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+	* src/autofit/afscript.h: Add Sinhala standard character and move data
+	out of AF_CONFIG_OPTION_INDIC block.
+
+	* src/autofit/afranges.c: Move Sinhala data out of
+	AF_CONFIG_OPTION_INDIC block.
+
+	* src/autofit/afstyles.h: Update Sinhala data; in particular, use
+	AF_WRITING_SYSTEM_LATIN.
+
 2016-02-27  Werner Lemberg  <[email protected]>
 
 	[autofit] Properly handle spikes pointing to the x-axis.
@@ -42,7 +62,7 @@
 
 	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
 
-	* src/autofit/afscript.h: Add Tamli standard character and move data
+	* src/autofit/afscript.h: Add Tamil standard character and move data
 	out of AF_CONFIG_OPTION_INDIC block.
 
 	* src/autofit/afranges.c: Move Tamil data out of
--- a/src/autofit/afblue.c
+++ b/src/autofit/afblue.c
@@ -140,6 +140,12 @@
     '\0',
     '\xE1', '\x80', '\x89', ' ', '\xE1', '\x80', '\x8A', ' ', '\xE1', '\x80', '\xA5', ' ', '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xA8', ' ', '\xE1', '\x81', '\x82', ' ', '\xE1', '\x81', '\x85', ' ', '\xE1', '\x81', '\x89',  /* ဉ ည ဥ ဩ ဨ ၂ ၅ ၉ */
     '\0',
+    '\xE0', '\xB6', '\x89', ' ', '\xE0', '\xB6', '\x9A', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\xB4', ' ', '\xE0', '\xB6', '\xBA', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB7', '\x86',  /* ඉ ක ඝ ඳ ප ය ල ෆ */
+    '\0',
+    '\xE0', '\xB6', '\x91', ' ', '\xE0', '\xB6', '\x94', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xA2', ' ', '\xE0', '\xB6', '\xA7', ' ', '\xE0', '\xB6', '\xAE', ' ', '\xE0', '\xB6', '\xB0', ' ', '\xE0', '\xB6', '\xBB',  /* එ ඔ ඝ ජ ට ථ ධ ර */
+    '\0',
+    '\xE0', '\xB6', '\xAF', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\x8B', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x96', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xB6', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xAF', '\xE0', '\xB7', '\x94',  /* ද ඳ උ ල තූ තු බු දු */
+    '\0',
     '\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x92', ' ', '\xE0', '\xAE', '\x93', ' ', '\xE0', '\xAE', '\xB1', ' ', '\xE0', '\xAE', '\x88', ' ', '\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9A',  /* உ ஒ ஓ ற ஈ க ங ச */
     '\0',
     '\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x9A', ' ', '\xE0', '\xAE', '\xB2', ' ', '\xE0', '\xAE', '\xB6', ' ', '\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9F', ' ', '\xE0', '\xAE', '\xAA',  /* க ச ல ஶ உ ங ட ப */
@@ -304,6 +310,10 @@
     { AF_BLUE_STRING_MYANMAR_ASCENDER,  AF_BLUE_PROPERTY_LATIN_TOP        },
     { AF_BLUE_STRING_MYANMAR_DESCENDER, 0                                 },
     { AF_BLUE_STRING_MAX,               0                                 },
+    { AF_BLUE_STRING_SINHALA_TOP,       AF_BLUE_PROPERTY_LATIN_TOP },
+    { AF_BLUE_STRING_SINHALA_BOTTOM,    0                          },
+    { AF_BLUE_STRING_SINHALA_DESCENDER, 0                          },
+    { AF_BLUE_STRING_MAX,               0                          },
     { AF_BLUE_STRING_TAMIL_TOP,    AF_BLUE_PROPERTY_LATIN_TOP },
     { AF_BLUE_STRING_TAMIL_BOTTOM, 0                          },
     { AF_BLUE_STRING_MAX,          0                          },
--- a/src/autofit/afblue.dat
+++ b/src/autofit/afblue.dat
@@ -214,6 +214,13 @@
   AF_BLUE_STRING_MYANMAR_DESCENDER
     "ဉ ည ဥ ဩ ဨ ၂ ၅ ၉"
 
+  AF_BLUE_STRING_SINHALA_TOP
+    "ඉ ක ඝ ඳ ප ය ල ෆ"
+  AF_BLUE_STRING_SINHALA_BOTTOM
+    "එ ඔ ඝ ජ ට ථ ධ ර"
+  AF_BLUE_STRING_SINHALA_DESCENDER
+    "ද ඳ උ ල තූ තු බු දු"
+
   AF_BLUE_STRING_TAMIL_TOP
     "உ ஒ ஓ ற ஈ க ங ச"
   AF_BLUE_STRING_TAMIL_BOTTOM
@@ -526,6 +533,12 @@
     { AF_BLUE_STRING_MYANMAR_ASCENDER,  AF_BLUE_PROPERTY_LATIN_TOP        }
     { AF_BLUE_STRING_MYANMAR_DESCENDER, 0                                 }
     { AF_BLUE_STRING_MAX,               0                                 }
+
+  AF_BLUE_STRINGSET_SINH
+    { AF_BLUE_STRING_SINHALA_TOP,       AF_BLUE_PROPERTY_LATIN_TOP }
+    { AF_BLUE_STRING_SINHALA_BOTTOM,    0                          }
+    { AF_BLUE_STRING_SINHALA_DESCENDER, 0                          }
+    { AF_BLUE_STRING_MAX,               0                          }
 
   AF_BLUE_STRINGSET_TAML
     { AF_BLUE_STRING_TAMIL_TOP,    AF_BLUE_PROPERTY_LATIN_TOP }
--- a/src/autofit/afblue.h
+++ b/src/autofit/afblue.h
@@ -134,18 +134,21 @@
     AF_BLUE_STRING_MYANMAR_BOTTOM = 1316,
     AF_BLUE_STRING_MYANMAR_ASCENDER = 1348,
     AF_BLUE_STRING_MYANMAR_DESCENDER = 1376,
-    AF_BLUE_STRING_TAMIL_TOP = 1408,
-    AF_BLUE_STRING_TAMIL_BOTTOM = 1440,
-    AF_BLUE_STRING_TELUGU_TOP = 1472,
-    AF_BLUE_STRING_TELUGU_BOTTOM = 1500,
-    AF_BLUE_STRING_THAI_TOP = 1528,
-    AF_BLUE_STRING_THAI_BOTTOM = 1552,
-    AF_BLUE_STRING_THAI_ASCENDER = 1580,
-    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1592,
-    AF_BLUE_STRING_THAI_DESCENDER = 1604,
-    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1620,
-    AF_BLUE_STRING_THAI_DIGIT_TOP = 1628,
-    af_blue_1_1 = 1639,
+    AF_BLUE_STRING_SINHALA_TOP = 1408,
+    AF_BLUE_STRING_SINHALA_BOTTOM = 1440,
+    AF_BLUE_STRING_SINHALA_DESCENDER = 1472,
+    AF_BLUE_STRING_TAMIL_TOP = 1516,
+    AF_BLUE_STRING_TAMIL_BOTTOM = 1548,
+    AF_BLUE_STRING_TELUGU_TOP = 1580,
+    AF_BLUE_STRING_TELUGU_BOTTOM = 1608,
+    AF_BLUE_STRING_THAI_TOP = 1636,
+    AF_BLUE_STRING_THAI_BOTTOM = 1660,
+    AF_BLUE_STRING_THAI_ASCENDER = 1688,
+    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1700,
+    AF_BLUE_STRING_THAI_DESCENDER = 1712,
+    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1728,
+    AF_BLUE_STRING_THAI_DIGIT_TOP = 1736,
+    af_blue_1_1 = 1747,
 #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,
@@ -219,10 +222,11 @@
     AF_BLUE_STRINGSET_LATP = 64,
     AF_BLUE_STRINGSET_MLYM = 71,
     AF_BLUE_STRINGSET_MYMR = 74,
-    AF_BLUE_STRINGSET_TAML = 79,
-    AF_BLUE_STRINGSET_TELU = 82,
-    AF_BLUE_STRINGSET_THAI = 85,
-    af_blue_2_1 = 93,
+    AF_BLUE_STRINGSET_SINH = 79,
+    AF_BLUE_STRINGSET_TAML = 83,
+    AF_BLUE_STRINGSET_TELU = 86,
+    AF_BLUE_STRINGSET_THAI = 89,
+    af_blue_2_1 = 97,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
     af_blue_2_1_1 = af_blue_2_1 + 2,
--- a/src/autofit/afranges.c
+++ b/src/autofit/afranges.c
@@ -406,6 +406,20 @@
   };
 
 
+  const AF_Script_UniRangeRec  af_sinh_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0D80UL,  0x0DFFUL ),  /* Sinhala */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_sinh_nonbase_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0DCAUL,  0x0DCAUL ),
+    AF_UNIRANGE_REC(  0x0DD2UL,  0x0DD6UL ),
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+
   const AF_Script_UniRangeRec  af_taml_uniranges[] =
   {
     AF_UNIRANGE_REC(  0x0B80UL,  0x0BFFUL ),  /* Tamil */
@@ -517,20 +531,6 @@
     AF_UNIRANGE_REC(  0x0B41UL,  0x0B44UL ),
     AF_UNIRANGE_REC(  0x0B4DUL,  0x0B56UL ),
     AF_UNIRANGE_REC(  0x0B62UL,  0x0B63UL ),
-    AF_UNIRANGE_REC(       0UL,       0UL )
-  };
-
-
-  const AF_Script_UniRangeRec  af_sinh_uniranges[] =
-  {
-    AF_UNIRANGE_REC(  0x0D80UL,  0x0DFFUL ),  /* Sinhala */
-    AF_UNIRANGE_REC(       0UL,       0UL )
-  };
-
-  const AF_Script_UniRangeRec  af_sinh_nonbase_uniranges[] =
-  {
-    AF_UNIRANGE_REC(  0x0DCAUL,  0x0DCAUL ),
-    AF_UNIRANGE_REC(  0x0DD2UL,  0x0DD6UL ),
     AF_UNIRANGE_REC(       0UL,       0UL )
   };
 
--- a/src/autofit/afscript.h
+++ b/src/autofit/afscript.h
@@ -129,6 +129,12 @@
           HINTING_BOTTOM_TO_TOP,
           "" )
 
+  SCRIPT( sinh, SINH,
+          "Sinhala",
+          HB_SCRIPT_SINHALA,
+          HINTING_BOTTOM_TO_TOP,
+          "\xE0\xB6\xA7" ) /* ට */
+
   /* only digit zero has a simple (round) shape in the Tamil script */
   SCRIPT( taml, TAML,
           "Tamil",
@@ -172,12 +178,6 @@
   SCRIPT( orya, ORYA,
           "Oriya",
           HB_SCRIPT_ORIYA,
-          HINTING_BOTTOM_TO_TOP,
-          "o" ) /* XXX */
-
-  SCRIPT( sinh, SINH,
-          "Sinhala",
-          HB_SCRIPT_SINHALA,
           HINTING_BOTTOM_TO_TOP,
           "o" ) /* XXX */
 
--- a/src/autofit/afstyles.h
+++ b/src/autofit/afstyles.h
@@ -189,6 +189,13 @@
          (AF_Blue_Stringset)0,
          AF_COVERAGE_DEFAULT )
 
+  STYLE( sinh_dflt, SINH_DFLT,
+         "Sinhala default style",
+         AF_WRITING_SYSTEM_LATIN,
+         AF_SCRIPT_SINH,
+         AF_BLUE_STRINGSET_SINH,
+         AF_COVERAGE_DEFAULT )
+
   STYLE( taml_dflt, TAML_DFLT,
          "Tamil default style",
          AF_WRITING_SYSTEM_LATIN,
@@ -226,7 +233,6 @@
   STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" )
   STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" )
   STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" )
-  STYLE_DEFAULT_INDIC( sinh, SINH, "Sinhala" )
   STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" )
   STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" )
   STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" )