mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 08:21:32 +01:00
fix for cmap4 and OS_2 subsetting: maximum character code allowed is 0xFFFF
This commit is contained in:
1 parent
8ed46c3678
commit
1db2c1d0da
8 files changed
+37
-7
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -90,6 +90,29 @@ test_subset_cmap_noop (void)
|
||||
hb_face_destroy (face_abc);
|
||||
}
|
||||
|
||||
static void
|
||||
test_subset_cmap4_no_exceeding_maximum_codepoint (void)
|
||||
{
|
||||
hb_face_t *face_origin = hb_test_open_font_file ("fonts/Mplus1p-Regular.ttf");
|
||||
hb_face_t *face_expected = hb_test_open_font_file ("fonts/Mplus1p-Regular-cmap4-testing.ttf");
|
||||
|
||||
hb_set_t *codepoints = hb_set_create ();
|
||||
hb_face_t *face_subset;
|
||||
hb_set_add (codepoints, 0x20);
|
||||
hb_set_add (codepoints, 0x21);
|
||||
hb_set_add (codepoints, 0x1d542);
|
||||
hb_set_add (codepoints, 0x201a2);
|
||||
|
||||
face_subset = hb_subset_test_create_subset (face_origin, hb_subset_test_create_input (codepoints));
|
||||
hb_set_destroy (codepoints);
|
||||
|
||||
hb_subset_test_check (face_expected, face_subset, HB_TAG ('c','m','a','p'));
|
||||
|
||||
hb_face_destroy (face_subset);
|
||||
hb_face_destroy (face_expected);
|
||||
hb_face_destroy (face_origin);
|
||||
}
|
||||
|
||||
// TODO(rsheeter) test cmap to no codepoints
|
||||
|
||||
int
|
||||
@@ -100,6 +123,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);
|
||||
hb_test_add (test_subset_cmap4_no_exceeding_maximum_codepoint);
|
||||
|
||||
return hb_test_run();
|
||||
}
|
||||
Reference in new issue
Block a user