From 1faf0caae165f680689610b20c467b9308275308 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Fri, 3 Apr 2020 16:10:34 +0100 Subject: [PATCH] Special-case 'smcp' when checking for exposed AAT features. This may be implemented by selectors under either LETTER_CASE or LOWER_CASE feature types in AAT, so we need to check for the presence of either one. Fixes #2307. --- src/hb-aat-map.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hb-aat-map.cc b/src/hb-aat-map.cc index 6e9fbf1be..acfd19fc1 100644 --- a/src/hb-aat-map.cc +++ b/src/hb-aat-map.cc @@ -53,7 +53,17 @@ void hb_aat_map_builder_t::add_feature (hb_tag_t tag, unsigned value) const hb_aat_feature_mapping_t *mapping = hb_aat_layout_find_feature_mapping (tag); if (!mapping) return; - if (!face->table.feat->exposes_feature (mapping->aatFeatureType)) return; + if (!face->table.feat->exposes_feature (mapping->aatFeatureType)) + { + // Special case: Chain::compile_flags will fall back to the deprecated version of + // small-caps if necessary, so we need to check for that possibility. + if (mapping->aatFeatureType == HB_AAT_LAYOUT_FEATURE_TYPE_LOWER_CASE && + mapping->selectorToEnable == HB_AAT_LAYOUT_FEATURE_SELECTOR_LOWER_CASE_SMALL_CAPS) + { + if (!face->table.feat->exposes_feature (HB_AAT_LAYOUT_FEATURE_TYPE_LETTER_CASE)) return; + } + else return; + } feature_info_t *info = features.push(); info->type = mapping->aatFeatureType;