diff --git a/src/autofit/afadjust.c b/src/autofit/afadjust.c index a0904e063..8255e8783 100644 --- a/src/autofit/afadjust.c +++ b/src/autofit/afadjust.c @@ -1398,12 +1398,21 @@ hb_set_t *result_set = hb( set_create )(); hb_set_t *gsub_lookups = hb( set_create )(); + hb_script_t script = af_hb_scripts[metrics->style_class->script]; + + unsigned int script_count = 1; + hb_tag_t script_tags[2]; - /* Compute set of all GSUB lookups. */ + hb( ot_tags_from_script_and_language )( script, NULL, + &script_count, script_tags, + NULL, NULL ); + script_tags[1] = HB_TAG_NONE; + + /* Compute set of all script-specific GSUB lookups. */ hb( ot_layout_collect_lookups )( hb_face, HB_OT_TAG_GSUB, - NULL, NULL, NULL, + script_tags, NULL, NULL, gsub_lookups ); /* Find all glyph alternates of the code points in */ diff --git a/src/autofit/afshaper.c b/src/autofit/afshaper.c index ae6c74f06..45e92a84d 100644 --- a/src/autofit/afshaper.c +++ b/src/autofit/afshaper.c @@ -89,7 +89,8 @@ #define SCRIPT( s, S, d, h, H, ss ) h, - static const hb_script_t scripts[] = + FT_LOCAL_ARRAY_DEF( hb_script_t ) + af_hb_scripts[] = { #include "afscript.h" }; @@ -127,7 +128,7 @@ face = hb( font_get_face )( globals->hb_font ); coverage_tags = coverages[style_class->coverage]; - script = scripts[style_class->script]; + script = af_hb_scripts[style_class->script]; /* Convert a HarfBuzz script tag into the corresponding OpenType */ /* tag or tags -- some Indic scripts like Devanagari have an old */ diff --git a/src/autofit/afshaper.h b/src/autofit/afshaper.h index 4a4176f89..71ecdeb03 100644 --- a/src/autofit/afshaper.h +++ b/src/autofit/afshaper.h @@ -25,6 +25,12 @@ FT_BEGIN_HEADER +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + FT_LOCAL_ARRAY( hb_script_t ) + af_hb_scripts[]; +#endif + + FT_Error af_shaper_get_coverage( AF_FaceGlobals globals, AF_StyleClass style_class,