From a42f918434ec132737b2107a2d7356d02d4919bc Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 3 Jan 2014 18:29:41 +0100 Subject: [PATCH] [autofit] Fix handling of default coverages. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): First handle non-default coverages, then the default coverage of the default script, and finally the other default coverages. --- ChangeLog | 8 ++++++++ src/autofit/afglobal.c | 23 +++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5352e63e..0dcd4a75c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-01-03 Werner Lemberg + + [autofit] Fix handling of default coverages. + + * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): + First handle non-default coverages, then the default coverage of the + default script, and finally the other default coverages. + 2014-01-03 Werner Lemberg [autofit] Fix scaling of HarfBuzz shaping. diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c index d92c6ade3..7682c1468 100644 --- a/src/autofit/afglobal.c +++ b/src/autofit/afglobal.c @@ -127,6 +127,7 @@ FT_Byte* gstyles = globals->glyph_styles; FT_UInt ss; FT_UInt i; + FT_UInt dflt = -1; /* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */ @@ -164,6 +165,9 @@ */ if ( style_class->coverage == AF_COVERAGE_DEFAULT ) { + if ( style_class->script == globals->module->default_script ) + dflt = ss; + for ( range = script_class->script_uni_ranges; range->first != 0; range++ ) @@ -192,9 +196,24 @@ } } } + else + { + /* get glyphs not directly addressable by cmap */ + af_get_coverage( globals, style_class, gstyles ); + } + } - /* get glyphs not directly addressable by cmap */ - af_get_coverage( globals, style_class, gstyles ); + /* handle the default OpenType features of the default script ... */ + af_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles ); + + /* ... and the remaining default OpenType features */ + for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ ) + { + AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss]; + + + if ( ss != dflt && style_class->coverage == AF_COVERAGE_DEFAULT ) + af_get_coverage( globals, style_class, gstyles ); } /* mark ASCII digits */