diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2012-08-31 18:12:01 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2012-08-31 19:18:20 -0400 |
commit | b85800f9de8976a7418ef9df467d3080c6ab0199 (patch) | |
tree | 7690a68ca11c97637d779bb61b86a45162bd7e8e /src/hb-ot-shape-complex-indic-machine.rl | |
parent | 327d14ef188396006d54af976506ab6f8bb2869a (diff) |
[Indic] Implement dotted-circle insertion for broken clusters
No panic, we reeally insert dotted circle when it's absolutely broken.
Fixes most of the dotted-circle cases against Uniscribe. (for Devanagari
fixes 80% of them, for Khmer 70%; the rest look like Uniscribe being
really bogus...)
I had to make a decision. Apparently Uniscribe adds one dotted circle
to each broken character. I tried that, but that goes wrong easily with
split matras. So I made it add only one dotted circle to an entire
broken syllable tail. As in: "if there was a dotted circle here, this
would have formed a correct cluster." That works better for split
stuff, and I like it more.
Diffstat (limited to 'src/hb-ot-shape-complex-indic-machine.rl')
-rw-r--r-- | src/hb-ot-shape-complex-indic-machine.rl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index 6c76d24d..c9309e94 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -75,12 +75,14 @@ halant_or_matra_group = (final_halant_group | matra_group{0,4}); consonant_syllable = Repha? (cn.halant_group){0,4} cn A? halant_or_matra_group? syllable_tail; vowel_syllable = reph? V.n? (ZWJ | (halant_group.cn){0,4} halant_or_matra_group? syllable_tail); standalone_cluster = reph? place_holder.n? (halant_group.cn){0,4} halant_or_matra_group? syllable_tail; +broken_cluster = n? (halant_group.cn){0,4} halant_or_matra_group syllable_tail; other = any; main := |* consonant_syllable => { found_syllable (consonant_syllable); }; vowel_syllable => { found_syllable (vowel_syllable); }; standalone_cluster => { found_syllable (standalone_cluster); }; + broken_cluster => { found_syllable (broken_cluster); *had_broken_cluster = true; }; other => { found_syllable (non_indic_cluster); }; *|; @@ -98,7 +100,7 @@ main := |* } HB_STMT_END static void -find_syllables (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer) +find_syllables (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, bool *had_broken_cluster) { unsigned int p, pe, eof, ts, te, act; int cs; |