[aat] Fallback to old style "Letter Case" small caps

Fixes https://github.com/harfbuzz/harfbuzz/issues/1342
This commit is contained in:
Behdad Esfahbod 2018-10-31 18:51:45 -07:00
parent f928931948
commit 40b19fd469
1 changed files with 8 additions and 0 deletions

View File

@ -955,12 +955,20 @@ struct Chain
const Feature &feature = featureZ[i];
uint16_t type = feature.featureType;
uint16_t setting = feature.featureSetting;
retry:
const hb_aat_map_builder_t::feature_info_t *info = map->features.bsearch (type);
if (info && info->setting == setting)
{
flags &= feature.disableFlags;
flags |= feature.enableFlags;
}
else if (type == 3/*kLetterCaseType*/ && setting == 3/*kSmallCapsSelector*/)
{
/* Deprecated. https://github.com/harfbuzz/harfbuzz/issues/1342 */
type = 37/*kLowerCaseType*/;
setting = 1/*kLowerCaseSmallCapsSelector*/;
goto retry;
}
}
}
return flags;