[subset] support option --layout-features

pull/2993/head
Qunxin Liu 4 years ago committed by Garret Rieger
parent 0989b5553a
commit cb5a6b5a27
  1. 91
      src/hb-subset-input.cc
  2. 2
      src/hb-subset-input.hh
  3. 147
      src/hb-subset-plan.cc
  4. 4
      src/hb-subset-plan.hh
  5. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.default.61,62,63.ttf
  6. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.default.61,63.ttf
  7. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.default.61.ttf
  8. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.default.retain-all-codepoint.ttf
  9. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints-retain-gids.61,62,63.ttf
  10. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints-retain-gids.61,63.ttf
  11. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints-retain-gids.61.ttf
  12. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints-retain-gids.retain-all-codepoint.ttf
  13. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints.61,62,63.ttf
  14. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints.61,63.ttf
  15. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints.61.ttf
  16. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints.retain-all-codepoint.ttf
  17. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.gids.61,62,63.ttf
  18. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.gids.61,63.ttf
  19. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.gids.61.ttf
  20. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.gids.62.ttf
  21. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.gids.63.ttf
  22. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.gids.retain-all-codepoint.ttf
  23. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.keep-all-layout-features.61,62,63.ttf
  24. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.keep-all-layout-features.61,63.ttf
  25. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.keep-all-layout-features.61.ttf
  26. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.keep-all-layout-features.62.ttf
  27. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.keep-all-layout-features.63.ttf
  28. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.keep-all-layout-features.retain-all-codepoint.ttf
  29. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.layout-features.61,62,63.ttf
  30. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.layout-features.61,63.ttf
  31. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.layout-features.61.ttf
  32. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.layout-features.62.ttf
  33. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.layout-features.63.ttf
  34. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.layout-features.retain-all-codepoint.ttf
  35. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-ids.61,62,63.ttf
  36. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-ids.61,63.ttf
  37. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-ids.61.ttf
  38. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-ids.retain-all-codepoint.ttf
  39. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-languages.61,62,63.ttf
  40. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-languages.61,63.ttf
  41. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-languages.61.ttf
  42. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-languages.retain-all-codepoint.ttf
  43. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-legacy.61,62,63.ttf
  44. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-legacy.61,63.ttf
  45. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-legacy.61.ttf
  46. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.name-legacy.retain-all-codepoint.ttf
  47. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.retain-gids.61,62,63.ttf
  48. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.retain-gids.61,63.ttf
  49. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.retain-gids.61.ttf
  50. BIN
      test/subset/data/expected/basics/Comfortaa-Regular-new.retain-gids.retain-all-codepoint.ttf
  51. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.keep-all-layout-features.61,62,63.ttf
  52. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.keep-all-layout-features.61,63.ttf
  53. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.keep-all-layout-features.61.ttf
  54. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.keep-all-layout-features.62.ttf
  55. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.keep-all-layout-features.63.ttf
  56. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.keep-all-layout-features.retain-all-codepoint.ttf
  57. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.layout-features.61,62,63.ttf
  58. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.layout-features.61,63.ttf
  59. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.layout-features.61.ttf
  60. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.layout-features.62.ttf
  61. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.layout-features.63.ttf
  62. BIN
      test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.layout-features.retain-all-codepoint.ttf
  63. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.keep-all-layout-features.61,62,63.ttf
  64. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.keep-all-layout-features.61,63.ttf
  65. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.keep-all-layout-features.61.ttf
  66. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.keep-all-layout-features.62.ttf
  67. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.keep-all-layout-features.63.ttf
  68. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.keep-all-layout-features.retain-all-codepoint.ttf
  69. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.layout-features.61,62,63.ttf
  70. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.layout-features.61,63.ttf
  71. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.layout-features.61.ttf
  72. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.layout-features.62.ttf
  73. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.layout-features.63.ttf
  74. BIN
      test/subset/data/expected/basics/Roboto-Regular.abc.layout-features.retain-all-codepoint.ttf
  75. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.default.1FC,21,41,20,62,63.otf
  76. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.default.61,62,63.otf
  77. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.default.D7,D8,D9,DA,DE.otf
  78. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.desubroutinize-retain-gids.1FC,21,41,20,62,63.otf
  79. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.desubroutinize-retain-gids.61,62,63.otf
  80. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf
  81. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.desubroutinize.1FC,21,41,20,62,63.otf
  82. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.desubroutinize.61,62,63.otf
  83. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.desubroutinize.D7,D8,D9,DA,DE.otf
  84. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.1FC,21,41,20,62,63.otf
  85. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.61,62,63.otf
  86. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf
  87. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-desubroutinize.1FC,21,41,20,62,63.otf
  88. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-desubroutinize.61,62,63.otf
  89. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-desubroutinize.D7,D8,D9,DA,DE.otf
  90. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-retain-gids.1FC,21,41,20,62,63.otf
  91. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-retain-gids.61,62,63.otf
  92. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints-retain-gids.D7,D8,D9,DA,DE.otf
  93. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints.1FC,21,41,20,62,63.otf
  94. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints.61,62,63.otf
  95. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.drop-hints.D7,D8,D9,DA,DE.otf
  96. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.retain-gids.1FC,21,41,20,62,63.otf
  97. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.retain-gids.61,62,63.otf
  98. BIN
      test/subset/data/expected/cff-full-font/SourceSansPro-Regular.retain-gids.D7,D8,D9,DA,DE.otf
  99. BIN
      test/subset/data/expected/full-font/Roboto-Regular.default.1FC,21,41,20,62,63.ttf
  100. BIN
      test/subset/data/expected/full-font/Roboto-Regular.default.61,62,63.ttf
  101. Some files were not shown because too many files have changed in this diff Show More

@ -48,12 +48,14 @@ hb_subset_input_create_or_fail ()
hb_set_add_range (input->name_ids, 0, 6);
input->name_languages = hb_set_create ();
hb_set_add (input->name_languages, 0x0409);
input->layout_features = hb_set_create ();
input->drop_tables = hb_set_create ();
input->drop_hints = false;
input->desubroutinize = false;
input->retain_gids = false;
input->name_legacy = false;
input->overlaps_flag = false;
input->retain_all_layout_features = false;
hb_tag_t default_drop_tables[] = {
// Layout disabled by default
@ -82,6 +84,94 @@ hb_subset_input_create_or_fail ()
input->drop_tables->add_array (default_drop_tables, ARRAY_LENGTH (default_drop_tables));
//copied from _layout_features_groups in fonttools
hb_tag_t default_layout_features[] = {
// default shaper
// common
HB_TAG ('r', 'v', 'r', 'n'),
HB_TAG ('c', 'c', 'm', 'p'),
HB_TAG ('l', 'i', 'g', 'a'),
HB_TAG ('l', 'o', 'c', 'l'),
HB_TAG ('m', 'a', 'r', 'k'),
HB_TAG ('m', 'k', 'm', 'k'),
HB_TAG ('r', 'l', 'i', 'g'),
//fractions
HB_TAG ('f', 'r', 'a', 'c'),
HB_TAG ('n', 'u', 'm', 'r'),
HB_TAG ('d', 'n', 'o', 'm'),
//horizontal
HB_TAG ('c', 'a', 'l', 't'),
HB_TAG ('c', 'l', 'i', 'g'),
HB_TAG ('c', 'u', 'r', 's'),
HB_TAG ('k', 'e', 'r', 'n'),
HB_TAG ('r', 'c', 'l', 't'),
//vertical
HB_TAG ('v', 'a', 'l', 't'),
HB_TAG ('v', 'e', 'r', 't'),
HB_TAG ('v', 'k', 'r', 'n'),
HB_TAG ('v', 'p', 'a', 'l'),
HB_TAG ('v', 'r', 't', '2'),
//ltr
HB_TAG ('l', 't', 'r', 'a'),
HB_TAG ('l', 't', 'r', 'm'),
//rtl
HB_TAG ('r', 't', 'l', 'a'),
HB_TAG ('r', 't', 'l', 'm'),
//Complex shapers
//arabic
HB_TAG ('i', 'n', 'i', 't'),
HB_TAG ('m', 'e', 'd', 'i'),
HB_TAG ('f', 'i', 'n', 'a'),
HB_TAG ('i', 's', 'o', 'l'),
HB_TAG ('m', 'e', 'd', '2'),
HB_TAG ('f', 'i', 'n', '2'),
HB_TAG ('f', 'i', 'n', '3'),
HB_TAG ('c', 's', 'w', 'h'),
HB_TAG ('m', 's', 'e', 't'),
HB_TAG ('s', 't', 'c', 'h'),
//hangul
HB_TAG ('l', 'j', 'm', 'o'),
HB_TAG ('v', 'j', 'm', 'o'),
HB_TAG ('t', 'j', 'm', 'o'),
//tibetan
HB_TAG ('a', 'b', 'v', 's'),
HB_TAG ('b', 'l', 'w', 's'),
HB_TAG ('a', 'b', 'v', 'm'),
HB_TAG ('b', 'l', 'w', 'm'),
//indic
HB_TAG ('n', 'u', 'k', 't'),
HB_TAG ('a', 'k', 'h', 'n'),
HB_TAG ('r', 'p', 'h', 'f'),
HB_TAG ('r', 'k', 'r', 'f'),
HB_TAG ('p', 'r', 'e', 'f'),
HB_TAG ('b', 'l', 'w', 'f'),
HB_TAG ('h', 'a', 'l', 'f'),
HB_TAG ('a', 'b', 'v', 'f'),
HB_TAG ('p', 's', 't', 'f'),
HB_TAG ('c', 'f', 'a', 'r'),
HB_TAG ('v', 'a', 't', 'u'),
HB_TAG ('c', 'j', 'c', 't'),
HB_TAG ('i', 'n', 'i', 't'),
HB_TAG ('p', 'r', 'e', 's'),
HB_TAG ('a', 'b', 'v', 's'),
HB_TAG ('b', 'l', 'w', 's'),
HB_TAG ('p', 's', 't', 's'),
HB_TAG ('h', 'a', 'l', 'n'),
HB_TAG ('d', 'i', 's', 't'),
HB_TAG ('a', 'b', 'v', 'm'),
HB_TAG ('b', 'l', 'w', 'm'),
};
input->layout_features->add_array (default_layout_features, ARRAY_LENGTH (default_layout_features));
return input;
}
@ -117,6 +207,7 @@ hb_subset_input_destroy (hb_subset_input_t *subset_input)
hb_set_destroy (subset_input->name_ids);
hb_set_destroy (subset_input->name_languages);
hb_set_destroy (subset_input->drop_tables);
hb_set_destroy (subset_input->layout_features);
free (subset_input);
}

@ -43,12 +43,14 @@ struct hb_subset_input_t
hb_set_t *name_ids;
hb_set_t *name_languages;
hb_set_t *drop_tables;
hb_set_t *layout_features;
bool drop_hints;
bool desubroutinize;
bool retain_gids;
bool name_legacy;
bool overlaps_flag;
bool retain_all_layout_features;
/* TODO
*
* features

@ -85,88 +85,96 @@ _remap_indexes (const hb_set_t *indexes,
}
#ifndef HB_NO_SUBSET_LAYOUT
static inline void
_gsub_closure_glyphs_lookups_features (hb_face_t *face,
hb_set_t *gids_to_retain,
hb_map_t *gsub_lookups,
hb_map_t *gsub_features,
script_langsys_map *gsub_langsys)
typedef void (*layout_collect_func_t) (hb_face_t *face, hb_tag_t table_tag, const hb_tag_t *scripts, const hb_tag_t *languages, const hb_tag_t *features, hb_set_t *lookup_indexes /* OUT */);
static void _collect_subset_layout (hb_face_t *face,
hb_tag_t table_tag,
const hb_set_t *layout_features_to_retain,
bool retain_all_features,
layout_collect_func_t layout_collect_func,
hb_set_t *lookup_indices /* OUT */)
{
hb_set_t lookup_indices;
hb_ot_layout_collect_lookups (face,
HB_OT_TAG_GSUB,
nullptr,
nullptr,
nullptr,
&lookup_indices);
hb_ot_layout_lookups_substitute_closure (face,
&lookup_indices,
gids_to_retain);
hb_blob_ptr_t<OT::GSUB> gsub = hb_sanitize_context_t ().reference_table<OT::GSUB> (face);
gsub->closure_lookups (face,
gids_to_retain,
&lookup_indices);
_remap_indexes (&lookup_indices, gsub_lookups);
// Collect and prune features
hb_set_t feature_indices;
hb_ot_layout_collect_features (face,
HB_OT_TAG_GSUB,
nullptr,
nullptr,
nullptr,
&feature_indices);
gsub->prune_features (gsub_lookups, &feature_indices);
hb_map_t duplicate_feature_map;
gsub->find_duplicate_features (gsub_lookups, &feature_indices, &duplicate_feature_map);
feature_indices.clear ();
gsub->prune_langsys (&duplicate_feature_map, gsub_langsys, &feature_indices);
_remap_indexes (&feature_indices, gsub_features);
if (retain_all_features)
{
layout_collect_func (face,
table_tag,
nullptr,
nullptr,
nullptr,
lookup_indices);
return;
}
gsub.destroy ();
if (hb_set_is_empty (layout_features_to_retain)) return;
unsigned num = layout_features_to_retain->get_population () + 1;
hb_tag_t *features = (hb_tag_t *) malloc (num * sizeof (hb_tag_t));
if (!features) return;
unsigned i = 0;
for (hb_tag_t f : layout_features_to_retain->iter ())
features[i++] = f;
features[i] = 0;
layout_collect_func (face,
table_tag,
nullptr,
nullptr,
features,
lookup_indices);
free (features);
}
template <typename T>
static inline void
_gpos_closure_lookups_features (hb_face_t *face,
const hb_set_t *gids_to_retain,
hb_map_t *gpos_lookups,
hb_map_t *gpos_features,
script_langsys_map *gpos_langsys)
_closure_glyphs_lookups_features (hb_face_t *face,
hb_set_t *gids_to_retain,
const hb_set_t *layout_features_to_retain,
bool retain_all_features,
hb_map_t *lookups,
hb_map_t *features,
script_langsys_map *langsys_map)
{
hb_blob_ptr_t<T> table = hb_sanitize_context_t ().reference_table<T> (face);
hb_tag_t table_tag = table->tableTag;
hb_set_t lookup_indices;
hb_ot_layout_collect_lookups (face,
HB_OT_TAG_GPOS,
nullptr,
nullptr,
nullptr,
&lookup_indices);
hb_blob_ptr_t<OT::GPOS> gpos = hb_sanitize_context_t ().reference_table<OT::GPOS> (face);
gpos->closure_lookups (face,
gids_to_retain,
_collect_subset_layout (face,
table_tag,
layout_features_to_retain,
retain_all_features,
hb_ot_layout_collect_lookups,
&lookup_indices);
if (table_tag == HB_OT_TAG_GSUB)
hb_ot_layout_lookups_substitute_closure (face,
&lookup_indices,
gids_to_retain);
table->closure_lookups (face,
gids_to_retain,
&lookup_indices);
_remap_indexes (&lookup_indices, gpos_lookups);
_remap_indexes (&lookup_indices, lookups);
// Collect and prune features
hb_set_t feature_indices;
hb_ot_layout_collect_features (face,
HB_OT_TAG_GPOS,
nullptr,
nullptr,
nullptr,
&feature_indices);
gpos->prune_features (gpos_lookups, &feature_indices);
_collect_subset_layout (face,
table_tag,
layout_features_to_retain,
retain_all_features,
hb_ot_layout_collect_features,
&feature_indices);
table->prune_features (lookups, &feature_indices);
hb_map_t duplicate_feature_map;
gpos->find_duplicate_features (gpos_lookups, &feature_indices, &duplicate_feature_map);
table->find_duplicate_features (lookups, &feature_indices, &duplicate_feature_map);
feature_indices.clear ();
gpos->prune_langsys (&duplicate_feature_map, gpos_langsys, &feature_indices);
_remap_indexes (&feature_indices, gpos_features);
table->prune_langsys (&duplicate_feature_map, langsys_map, &feature_indices);
_remap_indexes (&feature_indices, features);
gpos.destroy ();
table.destroy ();
}
#endif
#ifndef HB_NO_VAR
@ -265,10 +273,10 @@ _populate_gids_to_retain (hb_subset_plan_t* plan,
#ifndef HB_NO_SUBSET_LAYOUT
if (close_over_gsub)
// closure all glyphs/lookups/features needed for GSUB substitutions.
_gsub_closure_glyphs_lookups_features (plan->source, plan->_glyphset_gsub, plan->gsub_lookups, plan->gsub_features, plan->gsub_langsys);
_closure_glyphs_lookups_features<OT::GSUB> (plan->source, plan->_glyphset_gsub, plan->layout_features, plan->retain_all_layout_features, plan->gsub_lookups, plan->gsub_features, plan->gsub_langsys);
if (close_over_gpos)
_gpos_closure_lookups_features (plan->source, plan->_glyphset_gsub, plan->gpos_lookups, plan->gpos_features, plan->gpos_langsys);
_closure_glyphs_lookups_features<OT::GPOS> (plan->source, plan->_glyphset_gsub, plan->layout_features, plan->retain_all_layout_features, plan->gpos_lookups, plan->gpos_features, plan->gpos_langsys);
#endif
_remove_invalid_gids (plan->_glyphset_gsub, plan->source->get_num_glyphs ());
@ -393,10 +401,12 @@ hb_subset_plan_create (hb_face_t *face,
plan->retain_gids = input->retain_gids;
plan->name_legacy = input->name_legacy;
plan->overlaps_flag = input->overlaps_flag;
plan->retain_all_layout_features = input->retain_all_layout_features;
plan->unicodes = hb_set_create ();
plan->name_ids = hb_set_reference (input->name_ids);
_nameid_closure (face, plan->name_ids);
plan->name_languages = hb_set_reference (input->name_languages);
plan->layout_features = hb_set_reference (input->layout_features);
plan->glyphs_requested = hb_set_reference (input->glyphs);
plan->drop_tables = hb_set_reference (input->drop_tables);
plan->source = hb_face_reference (face);
@ -456,6 +466,7 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan)
hb_set_destroy (plan->unicodes);
hb_set_destroy (plan->name_ids);
hb_set_destroy (plan->name_languages);
hb_set_destroy (plan->layout_features);
hb_set_destroy (plan->glyphs_requested);
hb_set_destroy (plan->drop_tables);
hb_face_destroy (plan->source);

@ -45,6 +45,7 @@ struct hb_subset_plan_t
bool retain_gids : 1;
bool name_legacy : 1;
bool overlaps_flag : 1;
bool retain_all_layout_features : 1;
// For each cp that we'd like to retain maps to the corresponding gid.
hb_set_t *unicodes;
@ -55,6 +56,9 @@ struct hb_subset_plan_t
// name_languages we would like to retain
hb_set_t *name_languages;
//layout features which will be preserved
hb_set_t *layout_features;
//glyph ids requested to retain
hb_set_t *glyphs_requested;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save