From 0dff11f6bfbda444a153ca75ff2b947f94e9b3c5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 30 Nov 2012 08:14:20 +0200 Subject: [PATCH] [OTLayout] Look for any 'size' feature, not only in DFLT script The old code doesn't work with all fonts, as Khaled has reported. --- src/hb-ot-layout.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 879266d76..5accbcf08 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -645,17 +645,13 @@ hb_ot_layout_get_size_params (hb_face_t *face, uint16_t *data /* OUT, 5 items */) { const OT::GPOS &gpos = _get_gpos (face); - unsigned int script_index; - gpos.find_script_index (HB_OT_TAG_DEFAULT_SCRIPT, &script_index); - const OT::LangSys &l = gpos.get_script (script_index).get_lang_sys (HB_OT_TAG_DEFAULT_LANGUAGE); - unsigned int num_features = l.get_feature_count (); - for (unsigned int i = 0; i < num_features; i++) { - unsigned int f_index = l.get_feature_index (i); - - if (HB_TAG ('s','i','z','e') == gpos.get_feature_tag (f_index)) + unsigned int num_features = gpos.get_feature_count (); + for (unsigned int i = 0; i < num_features; i++) + { + if (HB_TAG ('s','i','z','e') == gpos.get_feature_tag (i)) { - const OT::Feature &f = gpos.get_feature (f_index); + const OT::Feature &f = gpos.get_feature (i); const OT::FeatureParams ¶ms = f.get_feature_params (); for (unsigned int i = 0; i < 5; i++)