diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index bc8ce5581..49ac0bf42 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -476,24 +476,20 @@ struct cff_subset_plan { unsigned int glyph; for (glyph = 1; glyph < plan->num_output_glyphs (); glyph++) { - hb_codepoint_t orig_glyph; - if (!plan->old_gid_for_new_gid (glyph, &orig_glyph)) + hb_codepoint_t old_glyph; + if (!plan->old_gid_for_new_gid (glyph, &old_glyph)) { - /* pretend a missing glyph has the last code + 1 - * as an attempt to minimize the number of ranges */ - code = last_code + 1; + /* Retain the code for the old missing glyph ID */ + old_glyph = glyph; } - else + code = acc.glyph_to_code (old_glyph); + if (code == CFF_UNDEF_CODE) { - code = acc.glyph_to_code (orig_glyph); - if (code == CFF_UNDEF_CODE) - { - subset_enc_num_codes = glyph - 1; - break; - } + subset_enc_num_codes = glyph - 1; + break; } - if (code != last_code + 1) + if ((last_code == CFF_UNDEF_CODE) || (code != last_code + 1)) { code_pair_t pair = { code, glyph }; subset_enc_code_ranges.push (pair); @@ -502,7 +498,7 @@ struct cff_subset_plan { if (encoding != &Null(Encoding)) { - hb_codepoint_t sid = acc.glyph_to_sid (orig_glyph); + hb_codepoint_t sid = acc.glyph_to_sid (old_glyph); encoding->get_supplement_codes (sid, supp_codes); for (unsigned int i = 0; i < supp_codes.length; i++) { @@ -540,22 +536,18 @@ struct cff_subset_plan { unsigned int glyph; for (glyph = 1; glyph < plan->num_output_glyphs (); glyph++) { - hb_codepoint_t orig_glyph; - if (!plan->old_gid_for_new_gid (glyph, &orig_glyph)) + hb_codepoint_t old_glyph; + if (!plan->old_gid_for_new_gid (glyph, &old_glyph)) { - /* pretend a missing glyph has the last sid + 1 - * as an attempt to minimize the number of ranges */ - sid = last_sid + 1; + /* Retain the SID for the old missing glyph ID */ + old_glyph = glyph; } - else - { - sid = acc.glyph_to_sid (orig_glyph); + sid = acc.glyph_to_sid (old_glyph); - if (!acc.is_CID ()) - sid = sidmap.add (sid); - } + if (!acc.is_CID ()) + sid = sidmap.add (sid); - if (sid != last_sid + 1) + if ((last_sid == CFF_UNDEF_CODE) || (sid != last_sid + 1)) { code_pair_t pair = { sid, glyph }; subset_charset_ranges.push (pair); diff --git a/test/api/fonts/SourceHanSans-Regular.41,4C2E.retaingids.otf b/test/api/fonts/SourceHanSans-Regular.41,4C2E.retaingids.otf index 3064ffe4b..6da8ad376 100644 Binary files a/test/api/fonts/SourceHanSans-Regular.41,4C2E.retaingids.otf and b/test/api/fonts/SourceHanSans-Regular.41,4C2E.retaingids.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf new file mode 100644 index 000000000..ca546541b Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.61,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.61,62,63.otf new file mode 100644 index 000000000..0f52e66b2 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.61,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf new file mode 100644 index 000000000..170c15109 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.1FC,21,41,20,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.1FC,21,41,20,62,63.otf new file mode 100644 index 000000000..87c8f00f3 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.1FC,21,41,20,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.61,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.61,62,63.otf new file mode 100644 index 000000000..f381f1389 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.61,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf new file mode 100644 index 000000000..f32a1fcfa Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.1FC,21,41,20,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.1FC,21,41,20,62,63.otf similarity index 100% rename from test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.1FC,21,41,20,62,63.otf rename to test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.1FC,21,41,20,62,63.otf diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.61,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.61,62,63.otf new file mode 100644 index 000000000..419dfa010 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.61,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.D7,D8,D9,DA,DE.otf similarity index 100% rename from test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.D7,D8,D9,DA,DE.otf rename to test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.D7,D8,D9,DA,DE.otf diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.1FC,21,41,20,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.1FC,21,41,20,62,63.otf new file mode 100644 index 000000000..9a5c09a17 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.1FC,21,41,20,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.61,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.61,62,63.otf new file mode 100644 index 000000000..f5b4ebdf4 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.61,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.D7,D8,D9,DA,DE.otf new file mode 100644 index 000000000..57f9a8d5e Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.D7,D8,D9,DA,DE.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf new file mode 100644 index 000000000..6e8660b0a Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.61,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.61,62,63.otf new file mode 100644 index 000000000..5b396dbaa Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.61,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf new file mode 100644 index 000000000..ea0cc5ea5 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.retain-gids.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.retain-gids.D7,D8,D9,DA,DE.otf new file mode 100644 index 000000000..f32a1fcfa Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.retain-gids.D7,D8,D9,DA,DE.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.retain-gids.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.retain-gids.D7,D8,D9,DA,DE.otf new file mode 100644 index 000000000..57f9a8d5e Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.retain-gids.D7,D8,D9,DA,DE.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.1FC,21,41,20,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.1FC,21,41,20,62,63.otf new file mode 100644 index 000000000..2caee794c Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.1FC,21,41,20,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.61,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.61,62,63.otf new file mode 100644 index 000000000..b428a7b12 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.61,62,63.otf differ diff --git a/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.D7,D8,D9,DA,DE.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.D7,D8,D9,DA,DE.otf new file mode 100644 index 000000000..ccb442822 Binary files /dev/null and b/test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.D7,D8,D9,DA,DE.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf new file mode 100644 index 000000000..8445645e0 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf new file mode 100644 index 000000000..9d2e5d64c Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.61,63,65,6B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.61,63,65,6B.otf new file mode 100644 index 000000000..6ca270ae9 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.61,63,65,6B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf new file mode 100644 index 000000000..50ec062c6 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E.otf new file mode 100644 index 000000000..fe8e71644 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize..otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize..otf deleted file mode 100644 index 7c0c5fdd8..000000000 Binary files a/test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize..otf and /dev/null differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf new file mode 100644 index 000000000..30087bc49 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf new file mode 100644 index 000000000..1ef807f7b Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.61,63,65,6B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.61,63,65,6B.otf new file mode 100644 index 000000000..55b42307d Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.61,63,65,6B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf new file mode 100644 index 000000000..991300e01 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E.otf new file mode 100644 index 000000000..2f3f863cd Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,3048,304A,304B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,3048,304A,304B.otf similarity index 64% rename from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,3048,304A,304B.otf rename to test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,3048,304A,304B.otf index 790b7141f..3f831014c 100644 Binary files a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,3048,304A,304B.otf and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,3048,304A,304B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf similarity index 65% rename from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf rename to test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf index c707bcd9a..9e6e9cf6e 100644 Binary files a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.61,63,65,6B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.61,63,65,6B.otf similarity index 73% rename from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.61,63,65,6B.otf rename to test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.61,63,65,6B.otf index 591d13905..02d7aaf79 100644 Binary files a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.61,63,65,6B.otf and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.61,63,65,6B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf similarity index 64% rename from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf rename to test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf index efc98b643..a1adef29e 100644 Binary files a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E.otf similarity index 84% rename from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E.otf rename to test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E.otf index 27c46765a..da13955aa 100644 Binary files a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E.otf and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,3048,304A,304B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,3048,304A,304B.otf new file mode 100644 index 000000000..c7b62506f Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,3048,304A,304B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf new file mode 100644 index 000000000..b1f9cb3fb Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.61,63,65,6B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.61,63,65,6B.otf new file mode 100644 index 000000000..03f8fff9d Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.61,63,65,6B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf new file mode 100644 index 000000000..0acb6ad71 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E.otf new file mode 100644 index 000000000..d9a5fabfd Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize..otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize..otf deleted file mode 100644 index a73617ad5..000000000 Binary files a/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize..otf and /dev/null differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,3048,304A,304B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,3048,304A,304B.otf new file mode 100644 index 000000000..bd5a87dea Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,3048,304A,304B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf new file mode 100644 index 000000000..bfda88603 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.61,63,65,6B.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.61,63,65,6B.otf new file mode 100644 index 000000000..f77e115d6 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.61,63,65,6B.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf new file mode 100644 index 000000000..71a222361 Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf differ diff --git a/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E.otf b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E.otf new file mode 100644 index 000000000..96da59a1e Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E.otf differ diff --git a/test/subset/data/profiles/desubroutinize-retain-gids.txt b/test/subset/data/profiles/desubroutinize-retain-gids.txt new file mode 100644 index 000000000..cbb37b6f1 --- /dev/null +++ b/test/subset/data/profiles/desubroutinize-retain-gids.txt @@ -0,0 +1,2 @@ +--desubroutinize +--retain-gids diff --git a/test/subset/data/profiles/drop-hints-desubroutinize-retain-gids.txt b/test/subset/data/profiles/drop-hints-desubroutinize-retain-gids.txt new file mode 100644 index 000000000..848620a2e --- /dev/null +++ b/test/subset/data/profiles/drop-hints-desubroutinize-retain-gids.txt @@ -0,0 +1,3 @@ +--no-hinting +--desubroutinize +--retain-gids diff --git a/test/subset/data/tests/full-font.tests b/test/subset/data/tests/full-font.tests index f422ff577..74c61fa15 100644 --- a/test/subset/data/tests/full-font.tests +++ b/test/subset/data/tests/full-font.tests @@ -5,6 +5,12 @@ SourceSansPro-Regular.otf PROFILES: default.txt drop-hints.txt +drop-hints-retain-gids.txt +retain-gids.txt +desubroutinize.txt +desubroutinize-retain-gids.txt +drop-hints-desubroutinize.txt +drop-hints-desubroutinize-retain-gids.txt SUBSETS: abc diff --git a/test/subset/data/tests/japanese.tests b/test/subset/data/tests/japanese.tests index fc5864666..e28891208 100644 --- a/test/subset/data/tests/japanese.tests +++ b/test/subset/data/tests/japanese.tests @@ -5,6 +5,12 @@ SourceHanSans-Regular.otf PROFILES: default.txt drop-hints.txt +drop-hints-retain-gids.txt +retain-gids.txt +desubroutinize.txt +desubroutinize-retain-gids.txt +drop-hints-desubroutinize.txt +drop-hints-desubroutinize-retain-gids.txt SUBSETS: 明 diff --git a/test/subset/subset_test_suite.py b/test/subset/subset_test_suite.py index 5e3368ed9..955a00d4b 100644 --- a/test/subset/subset_test_suite.py +++ b/test/subset/subset_test_suite.py @@ -34,7 +34,7 @@ class Test: return font_base_name_parts[1] def applicable(self): - return self.profile_path.find("desubroutinize") < 0 or self.get_font_extension() == "otf" + return self.profile_path.find("desubroutinize") < 0 and self.profile_path.find("retain-gids") < 0 or self.get_font_extension() == ".otf" # A group of tests to perform on the subsetter. Each test # Identifies a font a subsetting profile, and a subset to be cut.