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

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Nov 25 15:12:48 PST 2013


 src/hb-ot-shape-complex-myanmar-machine.rl                             |    5 +-
 src/hb-ot-shape-complex-myanmar.cc                                     |   23 +++++++++-
 test/shaping/texts/in-tree/shaper-myanmar/script-myanmar/misc/misc.txt |    4 +
 3 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit 9174a9db5c4e01284143ed8bd318ce9454535987
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Nov 25 18:10:38 2013 -0500

    [myanmar] Allow punctuation clusters
    
    The spec and Uniscribe don't allow these, but UTN#11
    specifically says the sequence U+104B,U+1038 is valid.
    As such, allow all "P V" sequences.  There's about
    eight sequences that match that structure, but Roozbeh
    thinks it's fine to allow all of them.
    
    Test case: U+104B, U+1038
    
    https://bugs.freedesktop.org/show_bug.cgi?id=71947

diff --git a/src/hb-ot-shape-complex-myanmar-machine.rl b/src/hb-ot-shape-complex-myanmar-machine.rl
index 2ac3e89..58ca8c8 100644
--- a/src/hb-ot-shape-complex-myanmar-machine.rl
+++ b/src/hb-ot-shape-complex-myanmar-machine.rl
@@ -61,6 +61,7 @@ VS   = 30;
 ZWJ  = 6;
 ZWNJ = 5;
 Ra   = 16;
+P    = 31;
 
 j = ZWJ|ZWNJ;			# Joiners
 k = (Ra As H);			# Kinzi
@@ -76,12 +77,14 @@ complex_syllable_tail = As* medial_group main_vowel_group post_vowel_group* pwo_
 syllable_tail = (H | complex_syllable_tail);
 
 consonant_syllable =	k? (c|IV|D|GB).VS? (H (c|IV).VS?)* syllable_tail;
+punctuation_cluster = 	P V;
 broken_cluster =	k? VS? syllable_tail;
 other =			any;
 
 main := |*
 	consonant_syllable	=> { found_syllable (consonant_syllable); };
 	j			=> { found_syllable (non_myanmar_cluster); };
+	punctuation_cluster	=> { found_syllable (punctuation_cluster); };
 	broken_cluster		=> { found_syllable (broken_cluster); };
 	other			=> { found_syllable (non_myanmar_cluster); };
 *|;
diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc
index c25d4b3..25ba726 100644
--- a/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/hb-ot-shape-complex-myanmar.cc
@@ -119,6 +119,7 @@ override_features_myanmar (hb_ot_shape_planner_t *plan)
 
 enum syllable_type_t {
   consonant_syllable,
+  punctuation_cluster,
   broken_cluster,
   non_myanmar_cluster,
 };
@@ -143,7 +144,8 @@ enum myanmar_category_t {
   OT_VBlw = 27,
   OT_VPre = 28,
   OT_VPst = 29,
-  OT_VS   = 30 /* Variation selectors */
+  OT_VS   = 30, /* Variation selectors */
+  OT_P    = 31  /* Punctuation */
 };
 
 
@@ -247,6 +249,10 @@ set_myanmar_properties (hb_glyph_info_t &info)
     case 0x108F: case 0x109A: case 0x109B: case 0x109C:
       cat = (indic_category_t) OT_SM;
       break;
+
+    case 0x104A: case 0x104B:
+      cat = (indic_category_t) OT_P;
+      break;
   }
 
   if (cat == OT_M)
@@ -410,6 +416,16 @@ initial_reordering_broken_cluster (const hb_ot_shape_plan_t *plan,
 }
 
 static void
+initial_reordering_punctuation_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. */
+}
+
+static void
 initial_reordering_non_myanmar_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
 					hb_face_t *face HB_UNUSED,
 					hb_buffer_t *buffer HB_UNUSED,
@@ -429,6 +445,7 @@ initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
   syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
   switch (syllable_type) {
   case consonant_syllable:	initial_reordering_consonant_syllable  (plan, face, buffer, start, end); return;
+  case punctuation_cluster:	initial_reordering_punctuation_cluster (plan, face, buffer, start, end); return;
   case broken_cluster:		initial_reordering_broken_cluster      (plan, face, buffer, start, end); return;
   case non_myanmar_cluster:	initial_reordering_non_myanmar_cluster (plan, face, buffer, start, end); return;
   }
commit 096b71e8ef0c1443f3f86069d5416b887af6e9e7
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Nov 25 18:03:34 2013 -0500

    [myanmar] Mark U+104E MYANMAR SYMBOL AFOREMENTIONED as Consonant
    
    The spec and Uniscribe treat it as consonant in the grammar, but
    it's not in IndicSyllableCategory.txt, so fix up.
    
    Test sequence: U+1004,U+103A,U+1039,U+104E
    
    https://bugs.freedesktop.org/show_bug.cgi?id=71948

diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc
index a32405a..c25d4b3 100644
--- a/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/hb-ot-shape-complex-myanmar.cc
@@ -186,6 +186,10 @@ set_myanmar_properties (hb_glyph_info_t &info)
 
   switch (u)
   {
+    case 0x104E:
+      cat = (indic_category_t) OT_C; /* The spec says C, IndicSyllableCategory doesn't have. */
+      break;
+
     case 0x002D: case 0x00A0: case 0x00D7: case 0x2012:
     case 0x2013: case 0x2014: case 0x2015: case 0x2022:
     case 0x25CC: case 0x25FB: case 0x25FC: case 0x25FD:
commit d2da5e0b4b4ffc1722403ffb90b8777cfa1cd174
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Nov 25 17:50:07 2013 -0500

    [myanmar] Relax pwo-tone group a bit
    
    This is broken sequence according to OpenType spec, Uniscribe,
    and current HarfBuzz implementation.  But Roozbeh says this
    is a valid sequence, so allow it.  There are multiple
    "(DB As?)?" constructs in the grammar, but Roozbeh thinks only
    this one needs changing.
    
    Test case: 1014,1063,103A
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=71949

diff --git a/src/hb-ot-shape-complex-myanmar-machine.rl b/src/hb-ot-shape-complex-myanmar-machine.rl
index 51d42dd..2ac3e89 100644
--- a/src/hb-ot-shape-complex-myanmar-machine.rl
+++ b/src/hb-ot-shape-complex-myanmar-machine.rl
@@ -70,7 +70,7 @@ c = C|Ra;			# is_consonant
 medial_group = MY? MR? ((MW MH? | MH) As?)?;
 main_vowel_group = VPre* VAbv* VBlw* A* (DB As?)?;
 post_vowel_group = VPst MH? As* VAbv* A* (DB As?)?;
-pwo_tone_group = PT A* (DB As?)?;
+pwo_tone_group = PT A* DB? As?;
 
 complex_syllable_tail = As* medial_group main_vowel_group post_vowel_group* pwo_tone_group* V* j?;
 syllable_tail = (H | complex_syllable_tail);
commit 9af91ca8ffee4a8d2804eff5d380b4f9749414d1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Nov 25 17:47:19 2013 -0500

    Add more Myanmar test cases
    
    All three are broken right now according to Roozbeh.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=71947
    https://bugs.freedesktop.org/show_bug.cgi?id=71948
    https://bugs.freedesktop.org/show_bug.cgi?id=71949

diff --git a/test/shaping/texts/in-tree/shaper-myanmar/script-myanmar/misc/misc.txt b/test/shaping/texts/in-tree/shaper-myanmar/script-myanmar/misc/misc.txt
index 470c7c0..bc55599 100644
--- a/test/shaping/texts/in-tree/shaper-myanmar/script-myanmar/misc/misc.txt
+++ b/test/shaping/texts/in-tree/shaper-myanmar/script-myanmar/misc/misc.txt
@@ -1 +1,5 @@
 သီဟိုဠ်မှ ဉာဏ်ကြီးရှင်သည် အာယုဝဍ္ဎနဆေးညွှန်းစာကို ဇလွန်ဈေးဘေးဗာဒံပင်ထက် အဓိဋ္ဌာန်လျက် ဂဃနဏဖတ်ခဲ့သည်။
+။း
+င်္၎
+နၣ်
+နၢၣ်



More information about the HarfBuzz mailing list