diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index bdc7e1d24..22e41e24a 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -2520,7 +2520,7 @@ hb_ot_layout_get_baseline_with_fallback (hb_font_t *font, hb_glyph_extents_t extents; /* Keep in sync with hb_ot_layout_get_horizontal_baseline_for_script */ - switch ((int) script_tag) + switch ((int) hb_ot_tag_to_script (script_tag)) { /* Unicode-1.1 additions */ case HB_SCRIPT_BENGALI: ch = 0x0995u; break; diff --git a/test/api/test-baseline.c b/test/api/test-baseline.c index 69412c20f..5db0616a3 100644 --- a/test/api/test-baseline.c +++ b/test/api/test-baseline.c @@ -105,13 +105,25 @@ test_ot_layout_base_with_fallback (void) font = hb_font_create (face); hb_ot_layout_get_baseline_with_fallback (font, HB_OT_LAYOUT_BASELINE_TAG_HANGING, HB_DIRECTION_LTR, - HB_SCRIPT_BENGALI, + HB_TAG ('b','e','n','g'), HB_TAG ('E','N','G',' '), &position); g_assert_cmpint (622, ==, position); hb_ot_layout_get_baseline_with_fallback (font, HB_OT_LAYOUT_BASELINE_TAG_HANGING, HB_DIRECTION_LTR, - HB_SCRIPT_TIBETAN, + HB_TAG ('b','n','g','2'), + HB_TAG ('E','N','G',' '), + &position); + g_assert_cmpint (622, ==, position); + + hb_ot_layout_get_baseline_with_fallback2 (font, HB_OT_LAYOUT_BASELINE_TAG_HANGING, HB_DIRECTION_LTR, + HB_SCRIPT_BENGALI, + hb_language_from_string ("bn", -1), + &position); + g_assert_cmpint (622, ==, position); + + hb_ot_layout_get_baseline_with_fallback (font, HB_OT_LAYOUT_BASELINE_TAG_HANGING, HB_DIRECTION_LTR, + HB_TAG ('t','i','b','t'), HB_TAG ('E','N','G',' '), &position); g_assert_cmpint (600, ==, position);