[style] Fall back to GPOS 'size' feature for optical size in style API

This commit is contained in:
Behdad Esfahbod 2021-09-09 10:59:01 -06:00
parent 37379f8f7d
commit a23ce28977
1 changed files with 3 additions and 1 deletions

View File

@ -112,9 +112,11 @@ hb_style_get_value (hb_font_t *font, hb_tag_t tag)
return face->table.OS2->is_italic () || face->table.head->is_italic () ? 1 : 0;
case HB_STYLE_TAG_OPTICAL_SIZE:
{
unsigned int lower, upper;
unsigned int lower, design, upper;
return face->table.OS2->v5 ().get_optical_size (&lower, &upper)
? (float) (lower + upper) / 2.f
: hb_ot_layout_get_size_params (face, &design, nullptr, nullptr, nullptr, nullptr)
? design / 10.
: 12.f;
}
case HB_STYLE_TAG_SLANT: