diff --git a/src/hb-style.cc b/src/hb-style.cc index dd54fdd9d..afa4a9f8f 100644 --- a/src/hb-style.cc +++ b/src/hb-style.cc @@ -63,6 +63,9 @@ hb_style_get_value (hb_font_t *font, hb_style_tag_t style_tag) } #endif + if (style_tag == HB_STYLE_TAG_OPTICAL_SIZE && font->ptem) + return font->ptem; + /* STAT */ float value; if (face->table.STAT->get_value (style_tag, &value)) diff --git a/test/api/test-style.c b/test/api/test-style.c index 23d2e41da..9225a0a09 100644 --- a/test/api/test-style.c +++ b/test/api/test-style.c @@ -70,6 +70,9 @@ test_face_fdsc (void) assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_WIDTH), 100); assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_WEIGHT), 400); + hb_font_set_ptem (font, 36); + assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_OPTICAL_SIZE), 36); + hb_font_destroy (font); hb_face_destroy (face); }