diff --git a/src/hb-style.cc b/src/hb-style.cc index c0c5c4832..ee2ffc497 100644 --- a/src/hb-style.cc +++ b/src/hb-style.cc @@ -72,8 +72,7 @@ float hb_style_get_value (hb_font_t *font, hb_style_tag_t style_tag) { if (unlikely (style_tag == HB_STYLE_TAG_SLANT_RATIO)) - return _hb_angle_to_ratio (hb_style_get_value (font, HB_STYLE_TAG_SLANT_ANGLE)) - + font->slant; + return _hb_angle_to_ratio (hb_style_get_value (font, HB_STYLE_TAG_SLANT_ANGLE)); hb_face_t *face = font->face; diff --git a/test/api/test-style.c b/test/api/test-style.c index 73accfb35..b4f91ea36 100644 --- a/test/api/test-style.c +++ b/test/api/test-style.c @@ -147,6 +147,22 @@ test_face_user_setting (void) hb_face_destroy (face); } +static void +test_synthetic_slant (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/AdobeVFPrototype_vsindex.otf"); + hb_font_t *font = hb_font_create (face); + + assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_SLANT_RATIO), 0); + + hb_font_set_synthetic_slant (font, 0.2); + + assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_SLANT_RATIO), 0.2); + + hb_font_destroy (font); + hb_face_destroy (face); +} + int main (int argc, char **argv) { @@ -155,6 +171,7 @@ main (int argc, char **argv) hb_test_add (test_empty_face); hb_test_add (test_regular_face); hb_test_add (test_face_user_setting); + hb_test_add (test_synthetic_slant); return hb_test_run (); }