[use] Special-case Chakma split-vowel decomp in the USE shaper. (#383)

This commit is contained in:
jfkthame 2016-12-28 18:00:51 +00:00 committed by Behdad Esfahbod
parent c4ca49d55b
commit 49ba698124
1 changed files with 20 additions and 1 deletions

View File

@ -558,6 +558,25 @@ reorder (const hb_ot_shape_plan_t *plan,
HB_BUFFER_DEALLOCATE_VAR (buffer, use_category); HB_BUFFER_DEALLOCATE_VAR (buffer, use_category);
} }
static bool
decompose_use (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t ab,
hb_codepoint_t *a,
hb_codepoint_t *b)
{
switch (ab)
{
/* Chakma:
* Special case where the Unicode decomp gives matras in the wrong order
* for cluster validation.
*/
case 0x1112Eu : *a = 0x11127u; *b= 0x11131u; return true;
case 0x1112Fu : *a = 0x11127u; *b= 0x11132u; return true;
}
return (bool) c->unicode->decompose (ab, a, b);
}
static bool static bool
compose_use (const hb_ot_shape_normalize_context_t *c, compose_use (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t a, hb_codepoint_t a,
@ -582,7 +601,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */ NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
NULL, /* decompose */ decompose_use,
compose_use, compose_use,
setup_masks_use, setup_masks_use,
NULL, /* disable_otl */ NULL, /* disable_otl */