diff --git a/test/api/fonts/Roboto-Regular.D7,D8,D9,DA,DE.ttf b/test/api/fonts/Roboto-Regular.D7,D8,D9,DA,DE.ttf new file mode 100644 index 000000000..38799ccbe Binary files /dev/null and b/test/api/fonts/Roboto-Regular.D7,D8,D9,DA,DE.ttf differ diff --git a/test/api/test-subset-cmap.c b/test/api/test-subset-cmap.c index 618b7259c..52548742d 100644 --- a/test/api/test-subset-cmap.c +++ b/test/api/test-subset-cmap.c @@ -49,6 +49,28 @@ test_subset_cmap (void) hb_face_destroy (face_ac); } +static void +test_subset_cmap_non_consecutive_glyphs (void) +{ + hb_face_t *face = hb_subset_test_open_font ("fonts/Roboto-Regular.D7,D8,D9,DA,DE.ttf"); + + hb_set_t *codepoints = hb_set_create (); + hb_face_t *face_subset; + hb_set_add (codepoints, 0xD7); + hb_set_add (codepoints, 0xD8); + hb_set_add (codepoints, 0xD9); + hb_set_add (codepoints, 0xDA); + hb_set_add (codepoints, 0xDE); + + face_subset = hb_subset_test_create_subset (face, hb_subset_test_create_input (codepoints)); + hb_set_destroy (codepoints); + + hb_subset_test_check (face, face_subset, HB_TAG ('c','m','a','p')); + + hb_face_destroy (face_subset); + hb_face_destroy (face); +} + static void test_subset_cmap_noop (void) { @@ -77,6 +99,7 @@ main (int argc, char **argv) hb_test_add (test_subset_cmap); hb_test_add (test_subset_cmap_noop); + hb_test_add (test_subset_cmap_non_consecutive_glyphs); return hb_test_run(); }