[subset] add a glyf subsetting test for a font with composite glyphs.

This commit is contained in:
Garret Rieger 2018-02-16 17:02:51 -07:00 committed by Behdad Esfahbod
parent c36d015b0e
commit df9e22656d
3 changed files with 21 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -52,6 +52,26 @@ test_subset_glyf (void)
hb_face_destroy (face_ac);
}
static void
test_subset_glyf_with_components (void)
{
hb_face_t *face_components = hb_subset_test_open_font ("fonts/Roboto-Regular.components.ttf");
hb_face_t *face_subset = hb_subset_test_open_font ("fonts/Roboto-Regular.components.subset.ttf");
hb_set_t *codepoints = hb_set_create();
hb_set_add (codepoints, 0x1fc);
hb_face_t *face_generated_subset = hb_subset_test_create_subset (face_components, codepoints);
hb_set_destroy (codepoints);
hb_subset_test_check (face_subset, face_generated_subset, HB_TAG ('g','l','y','f'));
hb_subset_test_check (face_subset, face_generated_subset, HB_TAG ('l','o','c', 'a'));
hb_subset_test_check (face_subset, face_generated_subset, HB_TAG ('m','a','x', 'p'));
hb_face_destroy (face_generated_subset);
hb_face_destroy (face_subset);
hb_face_destroy (face_components);
}
static void
test_subset_glyf_noop (void)
{
@ -79,6 +99,7 @@ main (int argc, char **argv)
hb_test_init (&argc, &argv);
hb_test_add (test_subset_glyf);
hb_test_add (test_subset_glyf_with_components);
hb_test_add (test_subset_glyf_noop);
return hb_test_run();