added flex extents test

This commit is contained in:
Michiharu Ariza 2018-10-18 13:04:41 -07:00
parent 8679d02b4b
commit e555ed961e
2 changed files with 23 additions and 0 deletions

Binary file not shown.

View File

@ -91,6 +91,28 @@ test_extents_cff1_legacyops (void)
hb_font_destroy (font); hb_font_destroy (font);
} }
static void
test_extents_cff1_flex (void)
{
hb_face_t *face = hb_subset_test_open_font ("fonts/cff1_flex.otf");
g_assert (face);
hb_font_t *font = hb_font_create (face);
hb_face_destroy (face);
g_assert (font);
hb_ot_font_set_funcs (font);
hb_glyph_extents_t extents;
hb_bool_t result = hb_font_get_glyph_extents (font, 1, &extents);
g_assert (result);
g_assert_cmpint (extents.x_bearing, ==, -20);
g_assert_cmpint (extents.y_bearing, ==, 520);
g_assert_cmpint (extents.width, ==, 540);
g_assert_cmpint (extents.height, ==, -540);
hb_font_destroy (font);
}
static void static void
test_extents_cff2 (void) test_extents_cff2 (void)
{ {
@ -162,6 +184,7 @@ main (int argc, char **argv)
hb_test_add (test_extents_cff1); hb_test_add (test_extents_cff1);
hb_test_add (test_extents_cff1_legacyops); hb_test_add (test_extents_cff1_legacyops);
hb_test_add (test_extents_cff1_flex);
hb_test_add (test_extents_cff2); hb_test_add (test_extents_cff2);
hb_test_add (test_extents_cff2_vsindex); hb_test_add (test_extents_cff2_vsindex);