提交 981748cb 编写于 作者: B Behdad Esfahbod

[Indic] If Khmer fonts have a 'liga' feature, use generic shaper

Seems to produce more coherent results than trying the Indic shaper on
them.  I'm looking at you, Kh-* fonts...
上级 6b19fa48
......@@ -248,8 +248,6 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_TELUGU:
/* Unicode-3.0 additions */
case HB_SCRIPT_KHMER:
case HB_SCRIPT_MYANMAR:
case HB_SCRIPT_SINHALA:
/* Unicode-4.1 additions */
......@@ -278,10 +276,25 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_SHARADA:
case HB_SCRIPT_TAKRI:
/* Only use Indic shaper if the font has Indic tables. */
if (planner->map.chosen_script[0] == HB_OT_TAG_DEFAULT_SCRIPT)
return &_hb_ot_complex_shaper_default;
else
return &_hb_ot_complex_shaper_indic;
case HB_SCRIPT_KHMER:
/* If the font has 'liga', let the generic shaper do it. */
if (planner->map.chosen_script[0] == HB_OT_TAG_DEFAULT_SCRIPT ||
hb_ot_layout_language_find_feature (planner->face, HB_OT_TAG_GSUB, planner->map.script_index[0], planner->map.language_index[0], HB_TAG ('l','i','g','a'), NULL))
return &_hb_ot_complex_shaper_default;
else
return &_hb_ot_complex_shaper_indic;
case HB_SCRIPT_MYANMAR:
/* For Myanmar, we only want to use the Indic shaper if the "new" script
* tag is found. For "old" script tag we want to use the default shaper. */
if (planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT &&
planner->map.chosen_script[0] != HB_TAG ('m','y','m','r'))
if (planner->map.chosen_script[0] == HB_TAG ('m','y','m','2'))
return &_hb_ot_complex_shaper_indic;
else
return &_hb_ot_complex_shaper_default;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册