[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Nov 20 22:05:33 PST 2012


 src/hb-ot-shape-complex-private.hh |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 16c914c2a6efeb6999054333985b1f711e33cf94
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Nov 21 01:04:15 2012 -0500

    [Indic] One more try at unbreaking Khmer fonts
    
    See comments and discussion on the list.

diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh
index 75dcc04..26871c2 100644
--- a/src/hb-ot-shape-complex-private.hh
+++ b/src/hb-ot-shape-complex-private.hh
@@ -284,16 +284,20 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
 	return &_hb_ot_complex_shaper_default;
 
     case HB_SCRIPT_KHMER:
-      /* If the font has 'liga', let the generic shaper do it. */
-      if (!planner->map.found_script[0] ||
+      /* A number of Khmer fonts in the wild don't have a 'pref' feature,
+       * and as such won't shape properly via the Indic shaper;
+       * however, they typically have 'liga' / 'clig' features that implement
+       * the necessary "reordering" by means of ligature substitutions.
+       * So we send such pref-less fonts through the generic shaper instead. */
+      if (planner->map.found_script[0] &&
 	  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
+					      HB_TAG ('p','r','e','f'),
+					      NULL))
 	return &_hb_ot_complex_shaper_indic;
-
+      else
+	return &_hb_ot_complex_shaper_default;
 
     case HB_SCRIPT_MYANMAR:
       /* For Myanmar, we only want to use the Indic shaper if the "new" script



More information about the HarfBuzz mailing list