diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index d5f7ec108c20785ddb2a311dfc5989625c6ca537..d297076e86496e92f53f647f0f4c85e0c400d823 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -857,6 +857,10 @@ struct SubrSubsetter drop.ends_in_hint = true; break; + case OpCode_dotsection: + str.values[pos].set_drop (); + break; + default: /* NONE */ break; diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 412443805d4687ac07525f793b50b1671edff3bb..c889e1067ba159cd4464ce869b7bdc978f8c4562 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -283,6 +283,7 @@ struct CFF1CSOpSet_Flatten : CFF1CSOpSet case OpCode_vstemhm: case OpCode_hintmask: case OpCode_cntrmask: + case OpCode_dotsection: if (param.drop_hints) { env.clear_args (); diff --git a/test/api/fonts/cff1_dotsect.nohints.otf b/test/api/fonts/cff1_dotsect.nohints.otf new file mode 100644 index 0000000000000000000000000000000000000000..faa932ee0836feb1d2b9c3844b7de9f42aa484e0 Binary files /dev/null and b/test/api/fonts/cff1_dotsect.nohints.otf differ diff --git a/test/api/fonts/cff1_dotsect.otf b/test/api/fonts/cff1_dotsect.otf new file mode 100644 index 0000000000000000000000000000000000000000..dabd4b38562aad3861e8cf5e532515ff662a71d8 Binary files /dev/null and b/test/api/fonts/cff1_dotsect.otf differ diff --git a/test/api/test-subset-cff1.c b/test/api/test-subset-cff1.c index 6ac57903dcc24a98d8f5104f2e949f615038f0fc..30204dd90ee578dae6a25580d7371505b2dd214b 100644 --- a/test/api/test-subset-cff1.c +++ b/test/api/test-subset-cff1.c @@ -266,6 +266,26 @@ test_subset_cff1_seac (void) hb_face_destroy (face); } +static void +test_subset_cff1_dotsection (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/cff1_dotsect.otf"); + hb_face_t *face_subset = hb_test_open_font_file ("fonts/cff1_dotsect.nohints.otf"); + + hb_set_t *codepoints = hb_set_create (); + hb_set_add (codepoints, 0x69); /* i */ + hb_subset_input_t *input = hb_subset_test_create_input (codepoints); + hb_subset_input_set_drop_hints (input, true); + hb_face_t *face_test = hb_subset_test_create_subset (face, input); + hb_set_destroy (codepoints); + + hb_subset_test_check (face_subset, face_test, HB_TAG ('C','F','F',' ')); + + hb_face_destroy (face_test); + hb_face_destroy (face_subset); + hb_face_destroy (face); +} + int main (int argc, char **argv) { @@ -282,6 +302,7 @@ main (int argc, char **argv) hb_test_add (test_subset_cff1_j_desubr_strip_hints); hb_test_add (test_subset_cff1_expert); hb_test_add (test_subset_cff1_seac); + hb_test_add (test_subset_cff1_dotsection); return hb_test_run (); }