shithub: freetype+ttf2subf

Download patch

ref: a3046567bc805de5d751c0e7f097038395037a2d
parent: fb5268cf7b062b91012df7cb864ffaeee642163b
author: Werner Lemberg <[email protected]>
date: Mon Sep 28 05:45:56 EDT 2015

[autofit] Add support for Lao script.

Thanks to Danh Hong <[email protected]> for guidance with blue zone
characters!

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

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

* src/autofit/afscript.h: Add Lao standard characters.

* src/autofit/afranges.c: Add Lao data.

* src/autofit/afstyles.h: Add Lao data.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2015-09-28  Werner Lemberg  <[email protected]>
+
+	[autofit] Add support for Lao script.
+
+	Thanks to Danh Hong <[email protected]> for guidance with blue zone
+	characters!
+
+	* src/autofit/afblue.dat: Add blue zone data for Lao.
+
+	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+	* src/autofit/afscript.h: Add Lao standard characters.
+
+	* src/autofit/afranges.c: Add Lao data.
+
+	* src/autofit/afstyles.h: Add Lao data.
+
 2015-09-27  suzuki toshiya  <[email protected]>
  
 	[base] Fix a leak by broken sfnt-PS or resource fork (#46028).
--- a/src/autofit/afblue.c
+++ b/src/autofit/afblue.c
@@ -64,6 +64,16 @@
     '\0',
     '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5',  /* קךןףץ */
     '\0',
+    '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\x94', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\xA1', '\xE0', '\xBA', '\xA5', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\x87',  /* າ ດ ອ ມ ລ ວ ຣ ງ */
+    '\0',
+    '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\x9A', '\xE0', '\xBA', '\x8D', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\xAE', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA2',  /* າ ອ ບ ຍ ຣ ຮ ວ ຢ */
+    '\0',
+    '\xE0', '\xBA', '\x9B', '\xE0', '\xBA', '\xA2', '\xE0', '\xBA', '\x9F', '\xE0', '\xBA', '\x9D',  /* ປ ຢ ຟ ຝ */
+    '\0',
+    '\xE0', '\xBB', '\x82', '\xE0', '\xBB', '\x84', '\xE0', '\xBB', '\x83',  /* ໂ ໄ ໃ */
+    '\0',
+    '\xE0', '\xBA', '\x87', '\xE0', '\xBA', '\x8A', '\xE0', '\xBA', '\x96', '\xE0', '\xBA', '\xBD', '\xE0', '\xBB', '\x86', '\xE0', '\xBA', '\xAF',  /* ງ ຊ ຖ ຽ ໆ ຯ */
+    '\0',
     'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S',  /* THEZOCQS */
     '\0',
     'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S',  /* HEZLOCUS */
@@ -193,6 +203,13 @@
     { AF_BLUE_STRING_HEBREW_BOTTOM,    0                             },
     { AF_BLUE_STRING_HEBREW_DESCENDER, 0                             },
     { AF_BLUE_STRING_MAX,              0                             },
+    { AF_BLUE_STRING_LAO_TOP,             AF_BLUE_PROPERTY_LATIN_TOP      |
+                                          AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },
+    { AF_BLUE_STRING_LAO_BOTTOM,          0                                 },
+    { AF_BLUE_STRING_LAO_ASCENDER,        AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_LAO_LARGE_ASCENDER,  AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_LAO_DESCENDER,       0                                 },
+    { AF_BLUE_STRING_MAX,                 0                                 },
     { AF_BLUE_STRING_LATIN_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },
     { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM,  0                                 },
     { AF_BLUE_STRING_LATIN_SMALL_F_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },
--- a/src/autofit/afblue.dat
+++ b/src/autofit/afblue.dat
@@ -120,6 +120,17 @@
   AF_BLUE_STRING_HEBREW_DESCENDER
     "קךןףץ"
 
+  AF_BLUE_STRING_LAO_TOP
+    "າ ດ ອ ມ ລ ວ ຣ ງ"
+  AF_BLUE_STRING_LAO_BOTTOM
+    "າ ອ ບ ຍ ຣ ຮ ວ ຢ"
+  AF_BLUE_STRING_LAO_ASCENDER
+    "ປ ຢ ຟ ຝ"
+  AF_BLUE_STRING_LAO_LARGE_ASCENDER
+    "ໂ ໄ ໃ"
+  AF_BLUE_STRING_LAO_DESCENDER
+    "ງ ຊ ຖ ຽ ໆ ຯ"
+
   AF_BLUE_STRING_LATIN_CAPITAL_TOP
     "THEZOCQS"
   AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
@@ -361,6 +372,15 @@
     { AF_BLUE_STRING_HEBREW_BOTTOM,    0                             }
     { AF_BLUE_STRING_HEBREW_DESCENDER, 0                             }
     { AF_BLUE_STRING_MAX,              0                             }
+
+  AF_BLUE_STRINGSET_LAO
+    { AF_BLUE_STRING_LAO_TOP,             AF_BLUE_PROPERTY_LATIN_TOP      |
+                                          AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
+    { AF_BLUE_STRING_LAO_BOTTOM,          0                                 }
+    { AF_BLUE_STRING_LAO_ASCENDER,        AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_LAO_LARGE_ASCENDER,  AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_LAO_DESCENDER,       0                                 }
+    { AF_BLUE_STRING_MAX,                 0                                 }
 
   AF_BLUE_STRINGSET_LATN
     { AF_BLUE_STRING_LATIN_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
--- a/src/autofit/afblue.h
+++ b/src/autofit/afblue.h
@@ -93,31 +93,36 @@
     AF_BLUE_STRING_HEBREW_TOP = 242,
     AF_BLUE_STRING_HEBREW_BOTTOM = 259,
     AF_BLUE_STRING_HEBREW_DESCENDER = 272,
-    AF_BLUE_STRING_LATIN_CAPITAL_TOP = 283,
-    AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 292,
-    AF_BLUE_STRING_LATIN_SMALL_F_TOP = 301,
-    AF_BLUE_STRING_LATIN_SMALL = 309,
-    AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 317,
-    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 323,
-    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 339,
-    AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 355,
-    AF_BLUE_STRING_LATIN_SUBS_SMALL = 371,
-    AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 399,
-    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 415,
-    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 439,
-    AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 461,
-    AF_BLUE_STRING_LATIN_SUPS_SMALL = 481,
-    AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 500,
-    AF_BLUE_STRING_TELUGU_TOP = 509,
-    AF_BLUE_STRING_TELUGU_BOTTOM = 531,
-    AF_BLUE_STRING_THAI_TOP = 553,
-    AF_BLUE_STRING_THAI_BOTTOM = 572,
-    AF_BLUE_STRING_THAI_ASCENDER = 594,
-    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 604,
-    AF_BLUE_STRING_THAI_DESCENDER = 614,
-    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 627,
-    AF_BLUE_STRING_THAI_DIGIT_TOP = 634,
-    af_blue_1_1 = 643,
+    AF_BLUE_STRING_LAO_TOP = 283,
+    AF_BLUE_STRING_LAO_BOTTOM = 308,
+    AF_BLUE_STRING_LAO_ASCENDER = 333,
+    AF_BLUE_STRING_LAO_LARGE_ASCENDER = 346,
+    AF_BLUE_STRING_LAO_DESCENDER = 356,
+    AF_BLUE_STRING_LATIN_CAPITAL_TOP = 375,
+    AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 384,
+    AF_BLUE_STRING_LATIN_SMALL_F_TOP = 393,
+    AF_BLUE_STRING_LATIN_SMALL = 401,
+    AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 409,
+    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 415,
+    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 431,
+    AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 447,
+    AF_BLUE_STRING_LATIN_SUBS_SMALL = 463,
+    AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 491,
+    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 507,
+    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 531,
+    AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 553,
+    AF_BLUE_STRING_LATIN_SUPS_SMALL = 573,
+    AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 592,
+    AF_BLUE_STRING_TELUGU_TOP = 601,
+    AF_BLUE_STRING_TELUGU_BOTTOM = 623,
+    AF_BLUE_STRING_THAI_TOP = 645,
+    AF_BLUE_STRING_THAI_BOTTOM = 664,
+    AF_BLUE_STRING_THAI_ASCENDER = 686,
+    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 696,
+    AF_BLUE_STRING_THAI_DESCENDER = 706,
+    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 719,
+    AF_BLUE_STRING_THAI_DIGIT_TOP = 726,
+    af_blue_1_1 = 735,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
     AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153,
@@ -180,12 +185,13 @@
     AF_BLUE_STRINGSET_DEVA = 10,
     AF_BLUE_STRINGSET_GREK = 16,
     AF_BLUE_STRINGSET_HEBR = 23,
-    AF_BLUE_STRINGSET_LATN = 27,
-    AF_BLUE_STRINGSET_LATB = 34,
-    AF_BLUE_STRINGSET_LATP = 41,
-    AF_BLUE_STRINGSET_TELU = 48,
-    AF_BLUE_STRINGSET_THAI = 51,
-    af_blue_2_1 = 59,
+    AF_BLUE_STRINGSET_LAO = 27,
+    AF_BLUE_STRINGSET_LATN = 33,
+    AF_BLUE_STRINGSET_LATB = 40,
+    AF_BLUE_STRINGSET_LATP = 47,
+    AF_BLUE_STRINGSET_TELU = 54,
+    AF_BLUE_STRINGSET_THAI = 57,
+    af_blue_2_1 = 65,
 #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
@@ -180,6 +180,21 @@
   };
 
 
+  const AF_Script_UniRangeRec  af_lao_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0E80UL,  0x0EFFUL ),  /* Lao */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_lao_nobase_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0EB1UL,  0x0EB1UL ),
+    AF_UNIRANGE_REC(  0x0EB4UL,  0x0EBCUL ),
+    AF_UNIRANGE_REC(  0x0EC8UL,  0x0ECDUL ),
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+
   const AF_Script_UniRangeRec  af_latn_uniranges[] =
   {
     AF_UNIRANGE_REC(  0x0020UL,  0x007FUL ),  /* Basic Latin (no control chars)         */
--- a/src/autofit/afscript.h
+++ b/src/autofit/afscript.h
@@ -55,6 +55,12 @@
           HB_SCRIPT_HEBREW,
           0x5DD, 0x0, 0x0 ) /* ם */
 
+  /* only digit zero has a simple shape in the Lao script */
+  SCRIPT( lao, LAO,
+          "Lao",
+          HB_SCRIPT_LAO,
+          0xED0, 0x0, 0x0 ) /* ໐ */
+
   SCRIPT( latn, LATN,
           "Latin",
           HB_SCRIPT_LATIN,
--- a/src/autofit/afstyles.h
+++ b/src/autofit/afstyles.h
@@ -108,6 +108,13 @@
          AF_BLUE_STRINGSET_HEBR,
          AF_COVERAGE_DEFAULT )
 
+  STYLE( lao_dflt, LAO_DFLT,
+         "Lao default style",
+         AF_WRITING_SYSTEM_LATIN,
+         AF_SCRIPT_LAO,
+         AF_BLUE_STRINGSET_LAO,
+         AF_COVERAGE_DEFAULT )
+
   META_STYLE_LATIN( latn, LATN, "Latin" )
 
   STYLE( latb_dflt, LATB_DFLT,