Commit 371f5c3b9d49fe82b05d763198a7606f9c9c689d

Werner Lemberg 2013-08-26T20:11:24

[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.

diff --git a/ChangeLog b/ChangeLog
index 3fb8c79..25689f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2013-08-26  Werner Lemberg  <wl@gnu.org>
 
+	[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  <wl@gnu.org>
+
 	[autofit] Improve tracing messages.
 
 	* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script
diff --git a/src/autofit/afblue.c b/src/autofit/afblue.c
index 1c13b77..c7a9e6a 100644
--- 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    },
diff --git a/src/autofit/afblue.dat b/src/autofit/afblue.dat
index 5f391d3..5527b2c 100644
--- a/src/autofit/afblue.dat
+++ b/src/autofit/afblue.dat
@@ -76,6 +76,13 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
   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
@@ -139,6 +146,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
     { 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
 
   AF_BLUE_STRINGSET_HANI
diff --git a/src/autofit/afblue.h b/src/autofit/afblue.h
index 3bb505c..67f6777 100644
--- a/src/autofit/afblue.h
+++ b/src/autofit/afblue.h
@@ -79,7 +79,10 @@ FT_BEGIN_HEADER
     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 @@ FT_BEGIN_HEADER
   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,
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 51a1bd0..21439ce 100644
--- 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,
 
@@ -2514,5 +2522,16 @@
     'o'
   )
 
+  AF_DEFINE_SCRIPT_CLASS(
+    af_hebr_script_class,
+
+    AF_SCRIPT_HEBR,
+    AF_BLUE_STRINGSET_HEBR,
+    AF_WRITING_SYSTEM_LATIN,
+
+    af_hebr_uniranges,
+    0x5DD /* ם */
+  )
+
 
 /* END */
diff --git a/src/autofit/aflatin.h b/src/autofit/aflatin.h
index d779604..8581fe5 100644
--- a/src/autofit/aflatin.h
+++ b/src/autofit/aflatin.h
@@ -32,11 +32,11 @@ FT_BEGIN_HEADER
   /* 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
 
 
diff --git a/src/autofit/afscript.h b/src/autofit/afscript.h
index 4e4567f..39801d3 100644
--- 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 )