X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fhb-ot-shape-complex-indic-machine.rl;h=53dc20df54b40fc6fe48530d7b3f8c7722d389ca;hb=97158392a5899ddb739afaac925128f33f699bd7;hp=e21814d0fc5de471d39aac69f0e16867f51a6032;hpb=d69d5ceaa0ad30e8d4b9783507c59c6d4221de4f;p=framework%2Fuifw%2Fharfbuzz.git diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index e21814d..53dc20d 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -59,15 +59,17 @@ z = ZWJ|ZWNJ; matra_group = M N? H?; syllable_tail = SM? (VD VD?)?; -action matched_syllable { - matched_syllable (c, last, p); - last = p; -} +action found_consonant_syllable { found_consonant_syllable (map, buffer, mask_array, last, p); } +action found_vowel_syllable { found_vowel_syllable (map, buffer, mask_array, last, p); } +action found_standalone_cluster { found_standalone_cluster (map, buffer, mask_array, last, p); } +action found_non_indic { found_non_indic (map, buffer, mask_array, last, p); } + +action next_syllable { set_cluster (buffer, p, last); last = p; } -consonant_syllable = (c.N? (z.H|H.z?))* c.N? A? (H.z? | matra_group*)? syllable_tail %(matched_syllable); -vowel_syllable = (Ra H)? V N? (z.H.c | ZWJ.c)? matra_group* syllable_tail; -standalone_cluster = (Ra H)? NBSP N? (z? H c)? matra_group* syllable_tail; -non_indic = X; +consonant_syllable = (c.N? (z.H|H.z?))* c.N? A? (H.z? | matra_group*)? syllable_tail %(found_consonant_syllable); +vowel_syllable = (Ra H)? V N? (z.H.c | ZWJ.c)? matra_group* syllable_tail %(found_vowel_syllable); +standalone_cluster = (Ra H)? NBSP N? (z? H c)? matra_group* syllable_tail %(found_standalone_cluster); +non_indic = X %(found_non_indic); syllable = consonant_syllable @@ -76,26 +78,35 @@ syllable = | non_indic ; -main := syllable**; +main := (syllable %(next_syllable))**; }%% -#include -#include +static void +set_cluster (hb_buffer_t *buffer, + unsigned int start, unsigned int end) +{ + unsigned int cluster = buffer->info[start].cluster; + + for (unsigned int i = start + 1; i < end; i++) + cluster = MIN (cluster, buffer->info[i].cluster); + for (unsigned int i = start; i < end; i++) + buffer->info[i].cluster = cluster; +} static void -find_syllables (hb_ot_shape_context_t *c) +find_syllables (const hb_ot_map_t *map, hb_buffer_t *buffer, hb_mask_t *mask_array) { unsigned int p, pe, eof; int cs; %%{ write init; - getkey c->buffer->info[p].indic_category(); + getkey buffer->info[p].indic_category(); }%% p = 0; - pe = eof = c->buffer->len; + pe = eof = buffer->len; unsigned int last = 0; %%{