Prefer morx table if GSUB is empty (no scripts)
Fixes https://github.com/harfbuzz/harfbuzz/issues/1348
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 093511e..00d4c0b 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -62,7 +62,11 @@
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);
}