Replaced CFF1 J subset font for better coverage

in api test-ot-extents-cff
This commit is contained in:
Michiharu Ariza 2018-10-11 10:53:44 -07:00
parent b5aa5dbb11
commit a6b6faf2b8
6 changed files with 24 additions and 9 deletions

Binary file not shown.

Binary file not shown.

View File

@ -49,6 +49,21 @@ test_extents_cff1 (void)
g_assert_cmpint (extents.width, ==, 381);
g_assert_cmpint (extents.height, ==, -510);
hb_face_t *face_j = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,3041,4C2E.otf");
g_assert (face_j);
hb_font_t *font_j = hb_font_create (face_j);
hb_face_destroy (face_j);
g_assert (font_j);
hb_ot_font_set_funcs (font_j);
hb_bool_t result_j = hb_font_get_glyph_extents (font_j, 3, &extents);
g_assert (result_j);
g_assert_cmpint (extents.x_bearing, ==, 34);
g_assert_cmpint (extents.y_bearing, ==, 840);
g_assert_cmpint (extents.width, ==, 920);
g_assert_cmpint (extents.height, ==, -907);
hb_font_destroy (font);
}

View File

@ -94,21 +94,21 @@ test_subset_cff1_strip_hints (void)
static void
test_subset_cff1_j (void)
{
hb_face_t *face_41_3041_4e9d = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,3041,4E9D.otf");
hb_face_t *face_41_4e9d = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,4E9D.otf");
hb_face_t *face_41_3041_4c2e = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,3041,4C2E.otf");
hb_face_t *face_41_4c2e = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,4C2E.otf");
hb_set_t *codepoints = hb_set_create ();
hb_face_t *face_41_3041_4e9d_subset;
hb_face_t *face_41_3041_4c2e_subset;
hb_set_add (codepoints, 0x41);
hb_set_add (codepoints, 0x4E9D);
face_41_3041_4e9d_subset = hb_subset_test_create_subset (face_41_3041_4e9d, hb_subset_test_create_input (codepoints));
hb_set_add (codepoints, 0x4C2E);
face_41_3041_4c2e_subset = hb_subset_test_create_subset (face_41_3041_4c2e, hb_subset_test_create_input (codepoints));
hb_set_destroy (codepoints);
hb_subset_test_check (face_41_4e9d, face_41_3041_4e9d_subset, HB_TAG ('C','F','F',' '));
hb_subset_test_check (face_41_4c2e, face_41_3041_4c2e_subset, HB_TAG ('C','F','F',' '));
hb_face_destroy (face_41_3041_4e9d_subset);
hb_face_destroy (face_41_3041_4e9d);
hb_face_destroy (face_41_4e9d);
hb_face_destroy (face_41_3041_4c2e_subset);
hb_face_destroy (face_41_3041_4c2e);
hb_face_destroy (face_41_4c2e);
}
int