shithub: freetype+ttf2subf

Download patch

ref: 371f5c3b9d49fe82b05d763198a7606f9c9c689d
parent: 098121dbb98e5f37ce79c6daeeb82b3277a5891a
author: Werner Lemberg <[email protected]>
date: Mon Aug 26 16:11:24 EDT 2013

[autofit] Add support for Hebrew script.

* src/autofit/afblue.dat: Add blue strings for Hebrew.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/aflatin.c (af_hebr_uniranges): New array.
(af_hebr_script_class): New script.
* src/autofit/aflatin.h, src/autofit/afscript.h: Updated.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2013-08-26  Werner Lemberg  <[email protected]>
 
+	[autofit] Add support for Hebrew script.
+
+	* src/autofit/afblue.dat: Add blue strings for Hebrew.
+	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+	* src/autofit/aflatin.c (af_hebr_uniranges): New array.
+	(af_hebr_script_class): New script.
+	* src/autofit/aflatin.h, src/autofit/afscript.h: Updated.
+
+2013-08-26  Werner Lemberg  <[email protected]>
+
 	[autofit] Improve tracing messages.
 
 	* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script
--- a/src/autofit/afblue.c
+++ b/src/autofit/afblue.c
@@ -35,6 +35,12 @@
     'x', 'z', 'r', 'o', 'e', 's', 'c',  /* xzroesc */
     '\0',
     'p', 'q', 'g', 'j', 'y',  /* pqgjy */
+    '\0',
+    '\xD7', '\x90', '\xD7', '\x91', '\xD7', '\x9D', '\xD7', '\xA4', '\xD7', '\xA9', '\xD7', '\x93', '\xD7', '\x92',  /* אבםפשדג */
+    '\0',
+    '\xD7', '\x90', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9B', '\xD7', '\x9E', '\xD7', '\xA1',  /* אהחכמס */
+    '\0',
+    '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5',  /* קךןףץ */
 #ifdef AF_CONFIG_OPTION_CJK
     '\0',
     '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0',  /* 他们你來們到和地 */
@@ -97,6 +103,10 @@
     { AF_BLUE_STRING_LATIN_SMALL,          0                                  },
     { AF_BLUE_STRING_LATIN_SMALL_MINOR,    0                                  },
     { AF_BLUE_STRING_MAX,                  0                                  },
+    { AF_BLUE_STRING_HEBREW_TOP,       AF_BLUE_PROPERTY_LATIN_TOP },
+    { AF_BLUE_STRING_HEBREW_BOTTOM,    0                          },
+    { AF_BLUE_STRING_HEBREW_DESCENDER, 0                          },
+    { AF_BLUE_STRING_MAX,              0                          },
 #ifdef AF_CONFIG_OPTION_CJK
     { AF_BLUE_STRING_CJK_TOP_FILL,      AF_BLUE_PROPERTY_CJK_TOP |
                                         AF_BLUE_PROPERTY_CJK_FILL    },
--- a/src/autofit/afblue.dat
+++ b/src/autofit/afblue.dat
@@ -76,6 +76,13 @@
   AF_BLUE_STRING_LATIN_SMALL_MINOR
     "pqgjy"
 
+  AF_BLUE_STRING_HEBREW_TOP
+    "אבםפשדג"
+  AF_BLUE_STRING_HEBREW_BOTTOM
+    "אהחכמס"
+  AF_BLUE_STRING_HEBREW_DESCENDER
+    "קךןףץ"
+
 #ifdef AF_CONFIG_OPTION_CJK
 
   AF_BLUE_STRING_CJK_TOP_FILL
@@ -138,6 +145,12 @@
     { AF_BLUE_STRING_LATIN_SMALL,          0                                  }
     { AF_BLUE_STRING_LATIN_SMALL_MINOR,    0                                  }
     { AF_BLUE_STRING_MAX,                  0                                  }
+
+  AF_BLUE_STRINGSET_HEBR
+    { AF_BLUE_STRING_HEBREW_TOP,       AF_BLUE_PROPERTY_LATIN_TOP }
+    { AF_BLUE_STRING_HEBREW_BOTTOM,    0                          }
+    { AF_BLUE_STRING_HEBREW_DESCENDER, 0                          }
+    { AF_BLUE_STRING_MAX,              0                          }
 
 #ifdef AF_CONFIG_OPTION_CJK
 
--- a/src/autofit/afblue.h
+++ b/src/autofit/afblue.h
@@ -79,7 +79,10 @@
     AF_BLUE_STRING_LATIN_SMALL_F_TOP = 18,
     AF_BLUE_STRING_LATIN_SMALL = 26,
     AF_BLUE_STRING_LATIN_SMALL_MINOR = 34,
-    af_blue_1_1 = 39,
+    AF_BLUE_STRING_HEBREW_TOP = 40,
+    AF_BLUE_STRING_HEBREW_BOTTOM = 55,
+    AF_BLUE_STRING_HEBREW_DESCENDER = 68,
+    af_blue_1_1 = 78,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRING_CJK_TOP_FILL = af_blue_1_1 + 1,
     AF_BLUE_STRING_CJK_TOP_UNFILL = af_blue_1_1 + 77,
@@ -141,7 +144,8 @@
   typedef enum  AF_Blue_Stringset_
   {
     AF_BLUE_STRINGSET_LATN = 0,
-    af_blue_2_1 = 7,
+    AF_BLUE_STRINGSET_HEBR = 7,
+    af_blue_2_1 = 11,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
     af_blue_2_1_1 = af_blue_2_1 + 4,
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -2503,6 +2503,14 @@
   };
 
 
+  static const AF_Script_UniRangeRec  af_hebr_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0590UL,  0x05FFUL ),  /* Hebrew */
+    AF_UNIRANGE_REC(  0xFB1DUL,  0xFB4FUL ),  /* Alphab. Present. Forms (Hebrew) */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+
   AF_DEFINE_SCRIPT_CLASS(
     af_latn_script_class,
 
@@ -2512,6 +2520,17 @@
 
     af_latn_uniranges,
     'o'
+  )
+
+  AF_DEFINE_SCRIPT_CLASS(
+    af_hebr_script_class,
+
+    AF_SCRIPT_HEBR,
+    AF_BLUE_STRINGSET_HEBR,
+    AF_WRITING_SYSTEM_LATIN,
+
+    af_hebr_uniranges,
+    0x5DD /* ם */
   )
 
 
--- a/src/autofit/aflatin.h
+++ b/src/autofit/aflatin.h
@@ -32,11 +32,11 @@
   /* the latin-specific script classes */
 
   AF_DECLARE_SCRIPT_CLASS( af_latn_script_class )  /* XXX */
+  AF_DECLARE_SCRIPT_CLASS( af_hebr_script_class )
 #if 0
   AF_DECLARE_SCRIPT_CLASS( af_armn_script_class )
   AF_DECLARE_SCRIPT_CLASS( af_cyrl_script_class )
   AF_DECLARE_SCRIPT_CLASS( af_grek_script_class )
-  AF_DECLARE_SCRIPT_CLASS( af_hebr_script_class )
 #endif
 
 
--- a/src/autofit/afscript.h
+++ b/src/autofit/afscript.h
@@ -25,6 +25,7 @@
   SCRIPT( deva, DEVA )
   SCRIPT( dflt, DFLT )
   SCRIPT( hani, HANI )
+  SCRIPT( hebr, HEBR )
   SCRIPT( latn, LATN )
 #ifdef FT_OPTION_AUTOFIT2
   SCRIPT( ltn2, LTN2 )