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

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri May 23 13:59:50 PDT 2014


 src/hb-ot-shape-complex-indic-machine.rl |   13 ++++++-------
 src/hb-ot-shape-complex-indic-private.hh |    4 ++--
 src/hb-ot-shape-complex-indic.cc         |   27 ++++++++++++++++++++-------
 3 files changed, 28 insertions(+), 16 deletions(-)

New commits:
commit e9b2a4cfe593bdbe9288571635ba26ac42ede987
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 23 15:49:10 2014 -0400

    [indic] Support U+1CED

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 230c8e4..f17cf41 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -215,6 +215,11 @@ set_indic_properties (hb_glyph_info_t &info)
    * For now, just treat them like regular tone marks. */
   else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1CE2, 0x1CE8)))
     cat = OT_A;
+  /* TODO: The following should only be allowed after some of
+   * the nasalization marks, maybe only for U+1CE9..U+1CF1.
+   * For now, just treat them like tone marks. */
+  else if (unlikely (u == 0x1CED))
+    cat = OT_A;
   /* The following are Visarga variants. */
   else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1CF2, 0x1CF3)))
   {
commit d19f8e85702a1e473efe2f02027984dcc127602a
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 23 15:45:50 2014 -0400

    [indic] Support U+A8F2..A8F7,1CE9..1CEC,1CEE..1CF1

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 89fc46c..230c8e4 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -221,6 +221,14 @@ set_indic_properties (hb_glyph_info_t &info)
     cat = OT_SM;
     ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_VISARGA == OT_SM);
   }
+  /* The following take marks in standalone clusters, similar to Avagraha. */
+  else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0xA8F2, 0xA8F7,
+						      0x1CE9, 0x1CEC,
+						      0x1CEE, 0x1CF1)))
+  {
+    cat = OT_Symbol;
+    ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol);
+  }
 
   if (unlikely (u == 0x17D1))
     cat = OT_X;
commit ddbdfcbf1c10eed0a7b81b29fee99f1bd22113e5
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 23 15:39:55 2014 -0400

    [indic] Simplify grammar
    
    No functional change.

diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl
index 926c2eb..8332348 100644
--- a/src/hb-ot-shape-complex-indic-machine.rl
+++ b/src/hb-ot-shape-complex-indic-machine.rl
@@ -69,19 +69,18 @@ cn = c.ZWJ?.n?;
 forced_rakar = ZWJ H ZWJ Ra;
 symbol = Symbol.N?;
 matra_group = z{0,3}.M.N?.(H | forced_rakar)?;
-syllable_tail2 = (SM.SM?.ZWNJ?)? A{0,3}? VD{0,2};
-syllable_tail =  (Coeng (cn|V))? syllable_tail2;
+syllable_tail = (SM.SM?.ZWNJ?)? A{0,3}? VD{0,2};
 place_holder = NBSP | DOTTEDCIRCLE;
 halant_group = (z?.h.(ZWJ.N?)?);
 final_halant_group = halant_group | h.ZWNJ;
 medial_group = CM?.CM2?;
-halant_or_matra_group = (final_halant_group | (h.ZWJ)? matra_group{0,4});
+halant_or_matra_group = (final_halant_group | (h.ZWJ)? matra_group{0,4}) (Coeng (cn|V))?;
 
 
 consonant_syllable =	Repha? (cn.halant_group){0,4} cn medial_group halant_or_matra_group syllable_tail;
 vowel_syllable =	reph? V.n? (ZWJ | (halant_group.cn){0,4} medial_group halant_or_matra_group syllable_tail);
 standalone_cluster =	reph? place_holder.n? (halant_group.cn){0,4} medial_group halant_or_matra_group syllable_tail;
-symbol_cluster = 	symbol syllable_tail2;
+symbol_cluster = 	symbol syllable_tail;
 broken_cluster =	reph? n? (halant_group.cn){0,4} medial_group halant_or_matra_group syllable_tail;
 other =			any;
 
commit 4e9b1f662b23966e67c548b86afeff2bec9b0eb7
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 23 15:38:42 2014 -0400

    [indic] Always start new syllable for Avagraha
    
    In fact, the previous grammar was ambigious.  No functional
    change.

diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl
index c64c03e..926c2eb 100644
--- a/src/hb-ot-shape-complex-indic-machine.rl
+++ b/src/hb-ot-shape-complex-indic-machine.rl
@@ -70,7 +70,7 @@ forced_rakar = ZWJ H ZWJ Ra;
 symbol = Symbol.N?;
 matra_group = z{0,3}.M.N?.(H | forced_rakar)?;
 syllable_tail2 = (SM.SM?.ZWNJ?)? A{0,3}? VD{0,2};
-syllable_tail =  (Coeng (cn|V))? symbol? syllable_tail2;
+syllable_tail =  (Coeng (cn|V))? syllable_tail2;
 place_holder = NBSP | DOTTEDCIRCLE;
 halant_group = (z?.h.(ZWJ.N?)?);
 final_halant_group = halant_group | h.ZWNJ;
commit 9f9bd9bf31161660214b8b39a78cdafbb79db1be
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 23 15:33:13 2014 -0400

    [indic] Rename avagraha cluster to symbol cluster
    
    In anticipation of adding more characters to that class of clusters.

diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl
index 5e28843..c64c03e 100644
--- a/src/hb-ot-shape-complex-indic-machine.rl
+++ b/src/hb-ot-shape-complex-indic-machine.rl
@@ -56,7 +56,7 @@ Coeng = 14;
 Repha = 15;
 Ra    = 16;
 CM    = 17;
-Avag  = 18;
+Symbol= 18;
 CM2   = 31;
 
 c = (C | Ra);			# is_consonant
@@ -67,10 +67,10 @@ reph = (Ra H | Repha);		# possible reph
 
 cn = c.ZWJ?.n?;
 forced_rakar = ZWJ H ZWJ Ra;
-avagraha = Avag.N?;
+symbol = Symbol.N?;
 matra_group = z{0,3}.M.N?.(H | forced_rakar)?;
 syllable_tail2 = (SM.SM?.ZWNJ?)? A{0,3}? VD{0,2};
-syllable_tail =  (Coeng (cn|V))? avagraha? syllable_tail2;
+syllable_tail =  (Coeng (cn|V))? symbol? syllable_tail2;
 place_holder = NBSP | DOTTEDCIRCLE;
 halant_group = (z?.h.(ZWJ.N?)?);
 final_halant_group = halant_group | h.ZWNJ;
@@ -81,7 +81,7 @@ halant_or_matra_group = (final_halant_group | (h.ZWJ)? matra_group{0,4});
 consonant_syllable =	Repha? (cn.halant_group){0,4} cn medial_group halant_or_matra_group syllable_tail;
 vowel_syllable =	reph? V.n? (ZWJ | (halant_group.cn){0,4} medial_group halant_or_matra_group syllable_tail);
 standalone_cluster =	reph? place_holder.n? (halant_group.cn){0,4} medial_group halant_or_matra_group syllable_tail;
-avagraha_cluster = 	avagraha syllable_tail2;
+symbol_cluster = 	symbol syllable_tail2;
 broken_cluster =	reph? n? (halant_group.cn){0,4} medial_group halant_or_matra_group syllable_tail;
 other =			any;
 
@@ -89,7 +89,7 @@ main := |*
 	consonant_syllable	=> { found_syllable (consonant_syllable); };
 	vowel_syllable		=> { found_syllable (vowel_syllable); };
 	standalone_cluster	=> { found_syllable (standalone_cluster); };
-	avagraha_cluster	=> { found_syllable (avagraha_cluster); };
+	symbol_cluster		=> { found_syllable (symbol_cluster); };
 	broken_cluster		=> { found_syllable (broken_cluster); };
 	other			=> { found_syllable (non_indic_cluster); };
 *|;
diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic-private.hh
index 3de5c20..fe8b207 100644
--- a/src/hb-ot-shape-complex-indic-private.hh
+++ b/src/hb-ot-shape-complex-indic-private.hh
@@ -60,7 +60,7 @@ enum indic_category_t {
   OT_Repha = 15, /* Atomically-encoded logical or visual repha. */
   OT_Ra = 16,
   OT_CM = 17,  /* Consonant-Medial. */
-  OT_Avag = 18, /* Avagraha. */
+  OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */
   OT_CM2 = 31 /* Consonant-Medial, second slot. */
 };
 
@@ -95,7 +95,7 @@ enum indic_position_t {
 enum indic_syllabic_category_t {
   INDIC_SYLLABIC_CATEGORY_OTHER			= OT_X,
 
-  INDIC_SYLLABIC_CATEGORY_AVAGRAHA		= OT_Avag,
+  INDIC_SYLLABIC_CATEGORY_AVAGRAHA		= OT_Symbol,
   INDIC_SYLLABIC_CATEGORY_BINDU			= OT_SM,
   INDIC_SYLLABIC_CATEGORY_CONSONANT		= OT_C,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD	= OT_C,
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index c20ffd0..89fc46c 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -271,7 +271,7 @@ set_indic_properties (hb_glyph_info_t &info)
   {
     pos = matra_position (u, pos);
   }
-  else if ((FLAG (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Avag))))
+  else if ((FLAG (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Symbol))))
   {
     pos = POS_SMVD;
   }
@@ -639,7 +639,7 @@ enum syllable_type_t {
   consonant_syllable,
   vowel_syllable,
   standalone_cluster,
-  avagraha_cluster,
+  symbol_cluster,
   broken_cluster,
   non_indic_cluster,
 };
@@ -1207,10 +1207,10 @@ initial_reordering_broken_cluster (const hb_ot_shape_plan_t *plan,
 }
 
 static void
-initial_reordering_avagraha_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
-				     hb_face_t *face HB_UNUSED,
-				     hb_buffer_t *buffer HB_UNUSED,
-				     unsigned int start HB_UNUSED, unsigned int end HB_UNUSED)
+initial_reordering_symbol_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
+				   hb_face_t *face HB_UNUSED,
+				   hb_buffer_t *buffer HB_UNUSED,
+				   unsigned int start HB_UNUSED, unsigned int end HB_UNUSED)
 {
   /* Nothing to do right now.  If we ever switch to using the output
    * buffer in the reordering process, we'd need to next_glyph() here. */
@@ -1238,7 +1238,7 @@ initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
   case consonant_syllable:	initial_reordering_consonant_syllable (plan, face, buffer, start, end); return;
   case vowel_syllable:		initial_reordering_vowel_syllable     (plan, face, buffer, start, end); return;
   case standalone_cluster:	initial_reordering_standalone_cluster (plan, face, buffer, start, end); return;
-  case avagraha_cluster:	initial_reordering_avagraha_cluster   (plan, face, buffer, start, end); return;
+  case symbol_cluster:		initial_reordering_symbol_cluster     (plan, face, buffer, start, end); return;
   case broken_cluster:		initial_reordering_broken_cluster     (plan, face, buffer, start, end); return;
   case non_indic_cluster:	initial_reordering_non_indic_cluster  (plan, face, buffer, start, end); return;
   }


More information about the HarfBuzz mailing list