[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
This commit is contained in:
Behdad Esfahbod 2013-11-25 18:10:38 -05:00
parent 096b71e8ef
commit 9174a9db5c
2 changed files with 21 additions and 1 deletions

View File

@ -61,6 +61,7 @@ VS = 30;
ZWJ = 6; ZWJ = 6;
ZWNJ = 5; ZWNJ = 5;
Ra = 16; Ra = 16;
P = 31;
j = ZWJ|ZWNJ; # Joiners j = ZWJ|ZWNJ; # Joiners
k = (Ra As H); # Kinzi 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); syllable_tail = (H | complex_syllable_tail);
consonant_syllable = k? (c|IV|D|GB).VS? (H (c|IV).VS?)* 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; broken_cluster = k? VS? syllable_tail;
other = any; other = any;
main := |* main := |*
consonant_syllable => { found_syllable (consonant_syllable); }; consonant_syllable => { found_syllable (consonant_syllable); };
j => { found_syllable (non_myanmar_cluster); }; j => { found_syllable (non_myanmar_cluster); };
punctuation_cluster => { found_syllable (punctuation_cluster); };
broken_cluster => { found_syllable (broken_cluster); }; broken_cluster => { found_syllable (broken_cluster); };
other => { found_syllable (non_myanmar_cluster); }; other => { found_syllable (non_myanmar_cluster); };
*|; *|;

View File

@ -119,6 +119,7 @@ override_features_myanmar (hb_ot_shape_planner_t *plan)
enum syllable_type_t { enum syllable_type_t {
consonant_syllable, consonant_syllable,
punctuation_cluster,
broken_cluster, broken_cluster,
non_myanmar_cluster, non_myanmar_cluster,
}; };
@ -143,7 +144,8 @@ enum myanmar_category_t {
OT_VBlw = 27, OT_VBlw = 27,
OT_VPre = 28, OT_VPre = 28,
OT_VPst = 29, 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: case 0x108F: case 0x109A: case 0x109B: case 0x109C:
cat = (indic_category_t) OT_SM; cat = (indic_category_t) OT_SM;
break; break;
case 0x104A: case 0x104B:
cat = (indic_category_t) OT_P;
break;
} }
if (cat == OT_M) if (cat == OT_M)
@ -409,6 +415,16 @@ initial_reordering_broken_cluster (const hb_ot_shape_plan_t *plan,
initial_reordering_consonant_syllable (plan, face, buffer, start, end); initial_reordering_consonant_syllable (plan, face, buffer, start, end);
} }
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 static void
initial_reordering_non_myanmar_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED, initial_reordering_non_myanmar_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
hb_face_t *face HB_UNUSED, hb_face_t *face 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); syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
switch (syllable_type) { switch (syllable_type) {
case consonant_syllable: initial_reordering_consonant_syllable (plan, face, buffer, start, end); return; 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 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; case non_myanmar_cluster: initial_reordering_non_myanmar_cluster (plan, face, buffer, start, end); return;
} }