[HarfBuzz] harfbuzz: Branch 'master' - 7 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue May 27 15:31:34 PDT 2014


 src/hb-ot-shape-complex-indic-machine.rl   |    4 +--
 src/hb-ot-shape-complex-indic-private.hh   |   16 ++++++++++--
 src/hb-ot-shape-complex-indic.cc           |   37 +++++++++--------------------
 src/hb-ot-shape-complex-myanmar-machine.rl |    2 -
 src/hb-ot-shape-complex-myanmar.cc         |    8 ------
 5 files changed, 30 insertions(+), 37 deletions(-)

New commits:
commit 52b562a6a058131c0103aaa5404d053e6465bb23
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 27 18:18:23 2014 -0400

    [indic] Clean up a bit
    
    No functional change intended.

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 6cfe522..bd6c765 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -225,21 +225,15 @@ set_indic_properties (hb_glyph_info_t &info)
     cat = OT_Symbol;
     ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol);
   }
-
-  if (unlikely (u == 0x17D1))
-    cat = OT_X;
-  if (cat == OT_X &&
-      unlikely (hb_in_range<hb_codepoint_t> (u, 0x17CB, 0x17D3) ||
-		u == 0x17DD)) /* Khmer Various signs */
+  else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x17CD, 0x17D1) ||
+		     u == 0x17CB || u == 0x17D3 || u == 0x17DD)) /* Khmer Various signs */
   {
     /* These are like Top Matras. */
     cat = OT_M;
     pos = POS_ABOVE_C;
   }
-  if (u == 0x17C6) /* Khmer Bindu doesn't like to be repositioned. */
-    cat = OT_N;
-
-  if (unlikely (u == 0x17D2)) cat = OT_Coeng; /* Khmer coeng */
+  else if (unlikely (u == 0x17C6)) cat = OT_N; /* Khmer Bindu doesn't like to be repositioned. */
+  else if (unlikely (u == 0x17D2)) cat = OT_Coeng; /* Khmer coeng */
   else if (unlikely (u == 0x200C)) cat = OT_ZWNJ;
   else if (unlikely (u == 0x200D)) cat = OT_ZWJ;
   else if (unlikely (u == 0x002D || u == 0x00D7 ||
@@ -250,8 +244,7 @@ set_indic_properties (hb_glyph_info_t &info)
   else if (unlikely (u == 0xA982)) cat = OT_SM; /* Javanese repha. */
   else if (unlikely (u == 0xA9BE)) cat = OT_CM2; /* Javanese medial ya. */
   else if (unlikely (u == 0xA9BD)) { cat = OT_M; pos = POS_POST_C; } /* Javanese vocalic r. */
-
-  if (cat == OT_Repha) {
+  else if (cat == OT_Repha) {
     /* There are two kinds of characters marked as Repha:
      * - The ones that are GenCat=Mn are already positioned visually, ie. after base. (eg. Khmer)
      * - The ones that are GenCat=Lo is encoded logically, ie. beginning of syllable. (eg. Malayalam)
commit 3bf652b90783e8244c153739585d95dc4162efb4
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 27 18:07:26 2014 -0400

    [indic] Treat U+002D and U+2010..2014 as placeholders

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index ae90383..6cfe522 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -242,7 +242,9 @@ set_indic_properties (hb_glyph_info_t &info)
   if (unlikely (u == 0x17D2)) cat = OT_Coeng; /* Khmer coeng */
   else if (unlikely (u == 0x200C)) cat = OT_ZWNJ;
   else if (unlikely (u == 0x200D)) cat = OT_ZWJ;
-  else if (unlikely (u == 0x00D7)) cat = OT_PLACEHOLDER;
+  else if (unlikely (u == 0x002D || u == 0x00D7 ||
+		     hb_in_range<hb_codepoint_t> (u, 0x2010, 0x2014)))
+				   cat = OT_PLACEHOLDER;
   else if (unlikely (u == 0x25CC)) cat = OT_DOTTEDCIRCLE;
   else if (unlikely (u == 0x0A71)) cat = OT_SM; /* GURMUKHI ADDAK.  Move it to the end. */
   else if (unlikely (u == 0xA982)) cat = OT_SM; /* Javanese repha. */
commit e0de95f40244924cb8f9f7abca7f53117044a0eb
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 27 17:58:34 2014 -0400

    [indic] Treat U+00D7 MULTIPLICATION SIGN as placeholder

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 5d8613c..ae90383 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -242,6 +242,7 @@ set_indic_properties (hb_glyph_info_t &info)
   if (unlikely (u == 0x17D2)) cat = OT_Coeng; /* Khmer coeng */
   else if (unlikely (u == 0x200C)) cat = OT_ZWNJ;
   else if (unlikely (u == 0x200D)) cat = OT_ZWJ;
+  else if (unlikely (u == 0x00D7)) cat = OT_PLACEHOLDER;
   else if (unlikely (u == 0x25CC)) cat = OT_DOTTEDCIRCLE;
   else if (unlikely (u == 0x0A71)) cat = OT_SM; /* GURMUKHI ADDAK.  Move it to the end. */
   else if (unlikely (u == 0xA982)) cat = OT_SM; /* Javanese repha. */
commit cf78dd483cbe1759a8ecb731879e041a53ba9bb3
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 27 17:53:37 2014 -0400

    [indic/myanmar] Rename OT_NBSP to OT_PLACEHOLDER

diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl
index 8332348..09b4ac5 100644
--- a/src/hb-ot-shape-complex-indic-machine.rl
+++ b/src/hb-ot-shape-complex-indic-machine.rl
@@ -49,7 +49,7 @@ M    = 7;
 SM   = 8;
 VD   = 9;
 A    = 10;
-NBSP = 11;
+PLACEHOLDER = 11;
 DOTTEDCIRCLE = 12;
 RS    = 13;
 Coeng = 14;
@@ -70,7 +70,7 @@ forced_rakar = ZWJ H ZWJ Ra;
 symbol = Symbol.N?;
 matra_group = z{0,3}.M.N?.(H | forced_rakar)?;
 syllable_tail = (SM.SM?.ZWNJ?)? A{0,3}? VD{0,2};
-place_holder = NBSP | DOTTEDCIRCLE;
+place_holder = PLACEHOLDER | DOTTEDCIRCLE;
 halant_group = (z?.h.(ZWJ.N?)?);
 final_halant_group = halant_group | h.ZWNJ;
 medial_group = CM?.CM2?;
diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic-private.hh
index beabe0d..266adbc 100644
--- a/src/hb-ot-shape-complex-indic-private.hh
+++ b/src/hb-ot-shape-complex-indic-private.hh
@@ -53,7 +53,7 @@ enum indic_category_t {
   OT_SM = 8,
   OT_VD = 9,
   OT_A = 10,
-  OT_NBSP = 11,
+  OT_PLACEHOLDER = 11,
   OT_DOTTEDCIRCLE = 12,
   OT_RS = 13, /* Register Shifter, used in Khmer OT spec. */
   OT_Coeng = 14, /* Khmer-style Virama. */
@@ -71,7 +71,7 @@ enum indic_category_t {
  * We treat Vowels and placeholders as if they were consonants.  This is safe because Vowels
  * cannot happen in a consonant syllable.  The plus side however is, we can call the
  * consonant syllable logic from the vowel syllable function and get it all right! */
-#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_DOTTEDCIRCLE))
+#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE))
 #define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))
 #define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng))
 
@@ -114,7 +114,7 @@ enum indic_syllabic_category_t {
   INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL	= OT_CM,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER	= OT_C,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL	= OT_CM,
-  INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER	= OT_NBSP,
+  INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER	= OT_PLACEHOLDER,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED	= OT_CM,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA	= OT_Repha,
   INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER	= OT_X,
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 7f1606c..5d8613c 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -1185,8 +1185,8 @@ initial_reordering_standalone_cluster (const hb_ot_shape_plan_t *plan,
 				       hb_buffer_t *buffer,
 				       unsigned int start, unsigned int end)
 {
-  /* We treat NBSP/dotted-circle as if they are consonants, so we should just chain.
-   * Only if not in compatibility mode that is... */
+  /* We treat placeholder/dotted-circle as if they are consonants, so we
+   * should just chain.  Only if not in compatibility mode that is... */
 
   if (hb_options ().uniscribe_bug_compatible)
   {
diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc
index 66ca1cf..149a025 100644
--- a/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/hb-ot-shape-complex-myanmar.cc
@@ -134,7 +134,7 @@ enum myanmar_category_t {
   OT_D   = 19, /* Digits except zero */
   OT_D0  = 20, /* Digit zero */
   OT_DB  = OT_N, /* Dot below */
-  OT_GB  = OT_NBSP,
+  OT_GB  = OT_PLACEHOLDER,
   OT_MH  = 21, /* Various consonant medial types */
   OT_MR  = 22, /* Various consonant medial types */
   OT_MW  = 23, /* Various consonant medial types */
commit 186ece94c8838e95db240d3e7c3ce415da6be81e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 27 17:49:45 2014 -0400

    [myanmar] Use OT_NBSP instead of OT_DOTTEDCIRCLE for OT_GB
    
    No functional change.

diff --git a/src/hb-ot-shape-complex-myanmar-machine.rl b/src/hb-ot-shape-complex-myanmar-machine.rl
index 8036e7c..9649a91 100644
--- a/src/hb-ot-shape-complex-myanmar-machine.rl
+++ b/src/hb-ot-shape-complex-myanmar-machine.rl
@@ -44,7 +44,7 @@ C    = 1;
 D    = 19;
 D0   = 20;
 DB   = 3;
-GB   = 12;
+GB   = 11;
 H    = 4;
 IV   = 2;
 MH   = 21;
diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc
index 3c540f3..66ca1cf 100644
--- a/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/hb-ot-shape-complex-myanmar.cc
@@ -134,7 +134,7 @@ enum myanmar_category_t {
   OT_D   = 19, /* Digits except zero */
   OT_D0  = 20, /* Digit zero */
   OT_DB  = OT_N, /* Dot below */
-  OT_GB  = OT_DOTTEDCIRCLE,
+  OT_GB  = OT_NBSP,
   OT_MH  = 21, /* Various consonant medial types */
   OT_MR  = 22, /* Various consonant medial types */
   OT_MW  = 23, /* Various consonant medial types */
commit cf71d28c380819cb0f7f0f22f6ff9e4aa881a2b8
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 27 17:47:43 2014 -0400

    [indic/myanmar] Refactor a few macros

diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic-private.hh
index fe8b207..beabe0d 100644
--- a/src/hb-ot-shape-complex-indic-private.hh
+++ b/src/hb-ot-shape-complex-indic-private.hh
@@ -64,6 +64,18 @@ enum indic_category_t {
   OT_CM2 = 31 /* Consonant-Medial, second slot. */
 };
 
+#define MEDIAL_FLAGS (FLAG (OT_CM) | FLAG (OT_CM2))
+
+/* Note:
+ *
+ * We treat Vowels and placeholders as if they were consonants.  This is safe because Vowels
+ * cannot happen in a consonant syllable.  The plus side however is, we can call the
+ * consonant syllable logic from the vowel syllable function and get it all right! */
+#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_DOTTEDCIRCLE))
+#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))
+#define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng))
+
+
 /* Visual positions in a syllable from left to right. */
 enum indic_position_t {
   POS_START,
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 6f51a79..7f1606c 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -145,28 +145,18 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
   return !!(FLAG (info.indic_category()) & flags);
 }
 
-#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))
 static inline bool
 is_joiner (const hb_glyph_info_t &info)
 {
   return is_one_of (info, JOINER_FLAGS);
 }
 
-#define MEDIAL_FLAGS (FLAG (OT_CM) | FLAG (OT_CM2))
-
-/* Note:
- *
- * We treat Vowels and placeholders as if they were consonants.  This is safe because Vowels
- * cannot happen in a consonant syllable.  The plus side however is, we can call the
- * consonant syllable logic from the vowel syllable function and get it all right! */
-#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_DOTTEDCIRCLE))
 static inline bool
 is_consonant (const hb_glyph_info_t &info)
 {
   return is_one_of (info, CONSONANT_FLAGS);
 }
 
-#define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng))
 static inline bool
 is_halant_or_coeng (const hb_glyph_info_t &info)
 {
diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc
index 50209ff..3c540f3 100644
--- a/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/hb-ot-shape-complex-myanmar.cc
@@ -157,12 +157,6 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
   return !!(FLAG (info.myanmar_category()) & flags);
 }
 
-/* Note:
- *
- * We treat Vowels and placeholders as if they were consonants.  This is safe because Vowels
- * cannot happen in a consonant syllable.  The plus side however is, we can call the
- * consonant syllable logic from the vowel syllable function and get it all right! */
-#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CM) | FLAG (OT_Ra) | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_GB))
 static inline bool
 is_consonant (const hb_glyph_info_t &info)
 {
commit 2307268e01d27a999b56a2f573dfcee8b2a7949b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 27 17:39:01 2014 -0400

    [indic] Treat U+0A72..0A73 like regular consonants
    
    Unicode 6.x IndicSyllableCategory categorizes them as
    placeholders, but they can subjoin.

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index f17cf41..6f51a79 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -209,7 +209,8 @@ set_indic_properties (hb_glyph_info_t &info)
   else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xA8E0, 0xA8F1)))
     cat = OT_VD;
   /* The following act like consonants. */
-  else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1CF5, 0x1CF6)))
+  else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0x0A72, 0x0A73,
+						      0x1CF5, 0x1CF6)))
     cat = OT_C;
   /* TODO: The following should only be allowed after a Visarga.
    * For now, just treat them like regular tone marks. */


More information about the HarfBuzz mailing list