summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2018-11-16 14:45:56 -0800
committerBehdad Esfahbod <behdad@behdad.org>2018-11-16 14:45:56 -0800
commiteafd515639497098436ecf4c7b836e231bced323 (patch)
treef062ea93e1d509089233a7bdfc8f83c8b780460c
parentaa06574823e27c4dbb378d2467a3e6f6f36af9fe (diff)
Prefer morx table if GSUB is empty (no scripts)
Fixes https://github.com/harfbuzz/harfbuzz/issues/1348
-rw-r--r--src/hb-ot-shape.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 093511ef..00d4c0b6 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -62,7 +62,11 @@ _hb_apply_morx (hb_face_t *face)
hb_aat_layout_has_substitution (face))
return true;
- return !hb_ot_layout_has_substitution (face) &&
+ /* Ignore empty GSUB tables. */
+ return (!hb_ot_layout_has_substitution (face) ||
+ !hb_ot_layout_table_get_script_tags (face,
+ HB_OT_TAG_GSUB,
+ 0, nullptr, nullptr)) &&
hb_aat_layout_has_substitution (face);
}