[util/hb-subset] Add --layout to keep GDEF/GSUB/GPOS
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 12 Dec 2018 16:32:57 +0000 (11:32 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 12 Dec 2018 16:32:57 +0000 (11:32 -0500)
Will become default and option removed in the future.

util/hb-subset.cc
util/options.cc
util/options.hh

index 9eb95bb..b7d9eb9 100644 (file)
@@ -89,6 +89,7 @@ struct subset_consumer_t
 
   void finish (const font_options_t *font_opts)
   {
+    hb_subset_input_set_drop_layout (input, !subset_options.keep_layout);
     hb_subset_input_set_drop_hints (input, subset_options.drop_hints);
     hb_subset_input_set_desubroutinize (input, subset_options.desubroutinize);
 
index eecd5db..4e6e29b 100644 (file)
@@ -975,6 +975,7 @@ subset_options_t::add_options (option_parser_t *parser)
 {
   GOptionEntry entries[] =
   {
+    {"layout", 0, 0, G_OPTION_ARG_NONE,  &this->keep_layout,   "Keep OpenType Layout tables",   nullptr},
     {"no-hinting", 0, 0, G_OPTION_ARG_NONE,  &this->drop_hints,   "Whether to drop hints",   nullptr},
     {"desubroutinize", 0, 0, G_OPTION_ARG_NONE,  &this->desubroutinize,   "Remove CFF/CFF2 use of subroutines",   nullptr},
 
index 9f57972..a4210c2 100644 (file)
@@ -670,6 +670,7 @@ struct subset_options_t : option_group_t
 {
   subset_options_t (option_parser_t *parser)
   {
+    keep_layout = false;
     drop_hints = false;
     desubroutinize = false;
 
@@ -678,6 +679,7 @@ struct subset_options_t : option_group_t
 
   void add_options (option_parser_t *parser);
 
+  hb_bool_t keep_layout;
   hb_bool_t drop_hints;
   hb_bool_t desubroutinize;
 };