added desubroutinize & retain-gids full test cases with CFF fonts
authorMichiharu Ariza <ariza@adobe.com>
Fri, 1 Feb 2019 22:50:01 +0000 (14:50 -0800)
committerMichiharu Ariza <ariza@adobe.com>
Fri, 1 Feb 2019 22:50:01 +0000 (14:50 -0800)
and CFF retain-gids fixes

54 files changed:
src/hb-subset-cff1.cc
test/api/fonts/SourceHanSans-Regular.41,4C2E.retaingids.otf
test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.61,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.1FC,21,41,20,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.61,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.1FC,21,41,20,62,63.otf [moved from test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.1FC,21,41,20,62,63.otf with 100% similarity]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.61,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.D7,D8,D9,DA,DE.otf [moved from test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.D7,D8,D9,DA,DE.otf with 100% similarity]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.1FC,21,41,20,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.61,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-retain-gids.D7,D8,D9,DA,DE.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.61,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.desubroutinize.retain-gids.D7,D8,D9,DA,DE.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints.retain-gids.D7,D8,D9,DA,DE.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.1FC,21,41,20,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.61,62,63.otf [new file with mode: 0644]
test/subset/data/expected/full-font/SourceSansPro-Regular.retain-gids.D7,D8,D9,DA,DE.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.61,63,65,6B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize-retain-gids.660E.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.desubroutinize..otf [deleted file]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,3048,304A,304B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.61,63,65,6B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,3048,304A,304B.otf [moved from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,3048,304A,304B.otf with 64% similarity]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf [moved from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf with 65% similarity]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.61,63,65,6B.otf [moved from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.61,63,65,6B.otf with 73% similarity]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf [moved from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf with 64% similarity]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize.660E.otf [moved from test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize.660E.otf with 84% similarity]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,3048,304A,304B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.61,63,65,6B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-retain-gids.660E.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints.desubroutinize..otf [deleted file]
test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,3048,304A,304B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.61,63,65,6B.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf [new file with mode: 0644]
test/subset/data/expected/japanese/SourceHanSans-Regular.retain-gids.660E.otf [new file with mode: 0644]
test/subset/data/profiles/desubroutinize-retain-gids.txt [new file with mode: 0644]
test/subset/data/profiles/drop-hints-desubroutinize-retain-gids.txt [new file with mode: 0644]
test/subset/data/tests/full-font.tests
test/subset/data/tests/japanese.tests
test/subset/subset_test_suite.py

index bc8ce55..49ac0bf 100644 (file)
@@ -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);
index 3064ffe..6da8ad3 100644 (file)
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 (file)
index 0000000..ca54654
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 (file)
index 0000000..0f52e66
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 (file)
index 0000000..170c151
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 (file)
index 0000000..87c8f00
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 (file)
index 0000000..f381f13
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 (file)
index 0000000..f32a1fc
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.61,62,63.otf b/test/subset/data/expected/full-font/SourceSansPro-Regular.drop-hints-desubroutinize.61,62,63.otf
new file mode 100644 (file)
index 0000000..419dfa0
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-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 (file)
index 0000000..9a5c09a
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 (file)
index 0000000..f5b4ebd
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 (file)
index 0000000..57f9a8d
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 (file)
index 0000000..6e8660b
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 (file)
index 0000000..5b396db
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 (file)
index 0000000..ea0cc5e
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 (file)
index 0000000..f32a1fc
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 (file)
index 0000000..57f9a8d
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 (file)
index 0000000..2caee79
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 (file)
index 0000000..b428a7b
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 (file)
index 0000000..ccb4428
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 (file)
index 0000000..8445645
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 (file)
index 0000000..9d2e5d6
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 (file)
index 0000000..6ca270a
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 (file)
index 0000000..50ec062
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 (file)
index 0000000..fe8e716
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 (file)
index 7c0c5fd..0000000
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 (file)
index 0000000..30087bc
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 (file)
index 0000000..1ef807f
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 (file)
index 0000000..55b4230
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 (file)
index 0000000..991300e
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 (file)
index 0000000..2f3f863
Binary files /dev/null and b/test/subset/data/expected/japanese/SourceHanSans-Regular.drop-hints-desubroutinize-retain-gids.660E.otf differ
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 790b714..3f83101 100644 (file)
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
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 c707bcd..9e6e9cf 100644 (file)
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
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 591d139..02d7aaf 100644 (file)
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
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 efc98b6..a1adef2 100644 (file)
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
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 27c4676..da13955 100644 (file)
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 (file)
index 0000000..c7b6250
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 (file)
index 0000000..b1f9cb3
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 (file)
index 0000000..03f8fff
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 (file)
index 0000000..0acb6ad
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 (file)
index 0000000..d9a5fab
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 (file)
index a73617a..0000000
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 (file)
index 0000000..bd5a87d
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 (file)
index 0000000..bfda886
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 (file)
index 0000000..f77e115
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 (file)
index 0000000..71a2223
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 (file)
index 0000000..96da59a
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 (file)
index 0000000..cbb37b6
--- /dev/null
@@ -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 (file)
index 0000000..848620a
--- /dev/null
@@ -0,0 +1,3 @@
+--no-hinting
+--desubroutinize
+--retain-gids
index f422ff5..74c61fa 100644 (file)
@@ -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
index fc58646..e288912 100644 (file)
@@ -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:
 明
index 5e3368e..955a00d 100644 (file)
@@ -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.