2 * Copyright © 2010 Behdad Esfahbod
3 * Copyright © 2011,2012 Google, Inc.
5 * This is part of HarfBuzz, a text shaping library.
7 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in
11 * all copies of this software.
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 * Google Author(s): Garret Rieger, Rod Sheeter
29 #include "face-options.hh"
30 #include "main-font-text.hh"
31 #include "output-options.hh"
33 #include <hb-subset.h>
36 * Command line interface to the harfbuzz font subsetter.
39 struct subset_main_t : option_parser_t, face_options_t, output_options_t<false>
42 : input (hb_subset_input_create_or_fail ())
46 hb_subset_input_destroy (input);
49 void parse_face (int argc, const char * const *argv)
51 option_parser_t parser;
52 face_options_t face_opts;
54 face_opts.add_options (&parser);
56 GOptionEntry entries[] =
58 {G_OPTION_REMAINING, 0, G_OPTION_FLAG_IN_MAIN,
59 G_OPTION_ARG_CALLBACK, (gpointer) &collect_face, nullptr, "[FONT-FILE] [TEXT]"},
62 parser.add_main_group (entries, &face_opts);
63 parser.add_options ();
65 g_option_context_set_ignore_unknown_options (parser.context, true);
66 g_option_context_set_help_enabled (parser.context, false);
68 char **args = (char **)
69 #if GLIB_CHECK_VERSION (2, 68, 0)
74 (argv, argc * sizeof (*argv));
75 parser.parse (&argc, &args);
78 set_face (face_opts.face);
81 void parse (int argc, char **argv)
84 for (auto i = 1; i < argc; i++)
85 if (!strncmp ("--help", argv[i], 6))
93 /* Do a preliminary parse to load font-face, such that we can use it
94 * during main option parsing. */
95 parse_face (argc, argv);
99 option_parser_t::parse (&argc, &argv);
102 int operator () (int argc, char **argv)
106 hb_face_t *new_face = nullptr;
107 for (unsigned i = 0; i < num_iterations; i++)
109 hb_face_destroy (new_face);
110 new_face = hb_subset_or_fail (face, input);
113 bool success = new_face;
116 hb_blob_t *result = hb_face_reference_blob (new_face);
117 write_file (output_file, result);
118 hb_blob_destroy (result);
121 hb_face_destroy (new_face);
123 return success ? 0 : 1;
127 write_file (const char *output_file, hb_blob_t *blob)
132 const char* data = hb_blob_get_data (blob, &size);
136 size_t ret = fwrite (data, 1, size, out_fp);
139 if (size && ferror (out_fp))
140 fail (false, "Failed to write output: %s", strerror (errno));
150 collect_face (const char *name,
155 collect_rest (const char *name,
162 unsigned num_iterations = 1;
163 hb_subset_input_t *input = nullptr;
167 parse_gids (const char *name G_GNUC_UNUSED,
172 subset_main_t *subset_main = (subset_main_t *) data;
173 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
174 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
175 hb_set_t *gids = hb_subset_input_glyph_set (subset_main->input);
177 if (!is_remove && !is_add) hb_set_clear (gids);
179 if (0 == strcmp (arg, "*"))
183 hb_set_invert (gids);
187 char *s = (char *) arg;
192 while (*s && strchr (", ", *s))
198 hb_codepoint_t start_code = strtoul (s, &p, 10);
199 if (s[0] == '-' || errno || s == p)
201 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
202 "Failed parsing glyph-index at: '%s'", s);
206 if (p && p[0] == '-') // ranges
209 hb_codepoint_t end_code = strtoul (s, &p, 10);
210 if (s[0] == '-' || errno || s == p)
212 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
213 "Failed parsing glyph-index at: '%s'", s);
217 if (end_code < start_code)
219 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
220 "Invalid glyph-index range %u-%u", start_code, end_code);
224 hb_set_add_range (gids, start_code, end_code);
226 hb_set_del_range (gids, start_code, end_code);
231 hb_set_add (gids, start_code);
233 hb_set_del (gids, start_code);
243 parse_glyphs (const char *name G_GNUC_UNUSED,
246 GError **error G_GNUC_UNUSED)
248 subset_main_t *subset_main = (subset_main_t *) data;
249 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
250 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
251 hb_set_t *gids = hb_subset_input_glyph_set (subset_main->input);
253 if (!is_remove && !is_add) hb_set_clear (gids);
255 if (0 == strcmp (arg, "*"))
259 hb_set_invert (gids);
264 const char *p_end = arg + strlen (arg);
266 hb_font_t *font = hb_font_create (subset_main->face);
269 while (p < p_end && (*p == ' ' || *p == ','))
273 while (end < p_end && *end != ' ' && *end != ',')
279 if (!hb_font_get_glyph_from_name (font, p, end - p, &gid))
281 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
282 "Failed parsing glyph name: '%s'", p);
287 hb_set_add (gids, gid);
289 hb_set_del (gids, gid);
294 hb_font_destroy (font);
300 parse_text (const char *name G_GNUC_UNUSED,
303 GError **error G_GNUC_UNUSED)
305 subset_main_t *subset_main = (subset_main_t *) data;
306 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
307 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
308 hb_set_t *unicodes = hb_subset_input_unicode_set (subset_main->input);
310 if (!is_remove && !is_add) hb_set_clear (unicodes);
312 if (0 == strcmp (arg, "*"))
314 hb_set_clear (unicodes);
316 hb_set_invert (unicodes);
320 for (gchar *c = (gchar *) arg;
322 c = g_utf8_find_next_char(c, nullptr))
324 gunichar cp = g_utf8_get_char(c);
326 hb_set_add (unicodes, cp);
328 hb_set_del (unicodes, cp);
334 parse_unicodes (const char *name G_GNUC_UNUSED,
339 subset_main_t *subset_main = (subset_main_t *) data;
340 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
341 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
342 hb_set_t *unicodes = hb_subset_input_unicode_set (subset_main->input);
344 if (!is_remove && !is_add) hb_set_clear (unicodes);
346 if (0 == strcmp (arg, "*"))
348 hb_set_clear (unicodes);
350 hb_set_invert (unicodes);
355 #define DELIMITERS "<+->{},;&#\\xXuUnNiI\n\t\v\f\r "
357 char *s = (char *) arg;
362 while (*s && strchr (DELIMITERS, *s))
368 hb_codepoint_t start_code = strtoul (s, &p, 16);
371 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
372 "Failed parsing Unicode at: '%s'", s);
376 if (p && p[0] == '-') // ranges
379 hb_codepoint_t end_code = strtoul (s, &p, 16);
380 if (s[0] == '-' || errno || s == p)
382 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
383 "Failed parsing Unicode at: '%s'", s);
387 if (end_code < start_code)
389 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
390 "Invalid Unicode range %u-%u", start_code, end_code);
394 hb_set_add_range (unicodes, start_code, end_code);
396 hb_set_del_range (unicodes, start_code, end_code);
401 hb_set_add (unicodes, start_code);
403 hb_set_del (unicodes, start_code);
413 parse_nameids (const char *name,
418 subset_main_t *subset_main = (subset_main_t *) data;
419 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
420 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
421 hb_set_t *name_ids = hb_subset_input_set (subset_main->input, HB_SUBSET_SETS_NAME_ID);
424 if (!is_remove && !is_add) hb_set_clear (name_ids);
426 if (0 == strcmp (arg, "*"))
428 hb_set_clear (name_ids);
430 hb_set_invert (name_ids);
434 char *s = (char *) arg;
439 while (*s && strchr (", ", *s))
445 hb_codepoint_t u = strtoul (s, &p, 10);
448 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
449 "Failed parsing nameID at: '%s'", s);
455 hb_set_add (name_ids, u);
457 hb_set_del (name_ids, u);
467 parse_name_languages (const char *name,
472 subset_main_t *subset_main = (subset_main_t *) data;
473 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
474 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
475 hb_set_t *name_languages = hb_subset_input_set (subset_main->input, HB_SUBSET_SETS_NAME_LANG_ID);
477 if (!is_remove && !is_add) hb_set_clear (name_languages);
479 if (0 == strcmp (arg, "*"))
481 hb_set_clear (name_languages);
483 hb_set_invert (name_languages);
487 char *s = (char *) arg;
492 while (*s && strchr (", ", *s))
498 hb_codepoint_t u = strtoul (s, &p, 10);
501 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
502 "Failed parsing name-language code at: '%s'", s);
508 hb_set_add (name_languages, u);
510 hb_set_del (name_languages, u);
519 template <hb_subset_flags_t flag>
521 set_flag (const char *name,
524 GError **error G_GNUC_UNUSED)
526 subset_main_t *subset_main = (subset_main_t *) data;
528 hb_subset_input_set_flags (subset_main->input,
529 hb_subset_input_get_flags (subset_main->input) | flag);
535 parse_layout_features (const char *name,
538 GError **error G_GNUC_UNUSED)
540 subset_main_t *subset_main = (subset_main_t *) data;
541 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
542 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
543 hb_set_t *layout_features = hb_subset_input_set (subset_main->input, HB_SUBSET_SETS_LAYOUT_FEATURE_TAG);
545 if (!is_remove && !is_add) hb_set_clear (layout_features);
547 if (0 == strcmp (arg, "*"))
549 hb_set_clear (layout_features);
551 hb_set_invert (layout_features);
555 char *s = strtok((char *) arg, ", ");
558 if (strlen (s) > 4) // table tags are at most 4 bytes
560 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
561 "Failed parsing table tag at: '%s'", s);
565 hb_tag_t tag = hb_tag_from_string (s, strlen (s));
568 hb_set_add (layout_features, tag);
570 hb_set_del (layout_features, tag);
572 s = strtok(nullptr, ", ");
579 parse_drop_tables (const char *name,
584 subset_main_t *subset_main = (subset_main_t *) data;
585 hb_bool_t is_remove = (name[strlen (name) - 1] == '-');
586 hb_bool_t is_add = (name[strlen (name) - 1] == '+');
587 hb_set_t *drop_tables = hb_subset_input_set (subset_main->input, HB_SUBSET_SETS_DROP_TABLE_TAG);
589 if (!is_remove && !is_add) hb_set_clear (drop_tables);
591 if (0 == strcmp (arg, "*"))
593 hb_set_clear (drop_tables);
595 hb_set_invert (drop_tables);
599 char *s = strtok((char *) arg, ", ");
602 if (strlen (s) > 4) // Table tags are at most 4 bytes.
604 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
605 "Failed parsing table tag at: '%s'", s);
609 hb_tag_t tag = hb_tag_from_string (s, strlen (s));
612 hb_set_add (drop_tables, tag);
614 hb_set_del (drop_tables, tag);
616 s = strtok(nullptr, ", ");
622 template <GOptionArgFunc line_parser, bool allow_comments=true>
624 parse_file_for (const char *name,
630 if (0 != strcmp (arg, "-"))
631 fp = fopen (arg, "r");
637 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
638 "Failed opening file `%s': %s",
639 arg, strerror (errno));
643 GString *gs = g_string_new (nullptr);
646 g_string_set_size (gs, 0);
648 while (fgets (buf, sizeof (buf), fp))
650 unsigned bytes = strlen (buf);
651 if (bytes && buf[bytes - 1] == '\n')
654 g_string_append_len (gs, buf, bytes);
657 g_string_append_len (gs, buf, bytes);
661 g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
662 "Failed reading file `%s': %s",
663 arg, strerror (errno));
666 g_string_append_c (gs, '\0');
670 char *comment = strchr (gs->str, '#');
675 line_parser ("+", gs->str, data, error);
682 g_string_free (gs, false);
688 subset_main_t::collect_face (const char *name,
693 face_options_t *thiz = (face_options_t *) data;
695 if (!thiz->font_file)
697 thiz->font_file = g_strdup (arg);
705 subset_main_t::collect_rest (const char *name,
710 subset_main_t *thiz = (subset_main_t *) data;
712 if (!thiz->font_file)
714 thiz->font_file = g_strdup (arg);
718 parse_text (name, arg, data, error);
723 subset_main_t::add_options ()
725 set_summary ("Subset fonts to specification.");
727 face_options_t::add_options (this);
729 GOptionEntry glyphset_entries[] =
731 {"gids", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_gids,
732 "Specify glyph IDs or ranges to include in the subset.\n"
734 "Use --gids-=... to subtract codepoints from the current set.", "list of glyph indices/ranges or *"},
735 {"gids-", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_gids, "Specify glyph IDs or ranges to remove from the subset", "list of glyph indices/ranges or *"},
736 {"gids+", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_gids, "Specify glyph IDs or ranges to include in the subset", "list of glyph indices/ranges or *"},
737 {"gids-file", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_file_for<parse_gids>, "Specify file to read glyph IDs or ranges from", "filename"},
738 {"glyphs", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_glyphs, "Specify glyph names to include in the subset. Use --glyphs-=... to subtract glyphs from the current set.", "list of glyph names or *"},
739 {"glyphs+", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_glyphs, "Specify glyph names to include in the subset", "list of glyph names"},
740 {"glyphs-", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_glyphs, "Specify glyph names to remove from the subset", "list of glyph names"},
743 {"glyphs-file", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_file_for<parse_glyphs>, "Specify file to read glyph names from", "filename"},
745 {"text", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_text, "Specify text to include in the subset. Use --text-=... to subtract codepoints from the current set.", "string"},
746 {"text-", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_text, "Specify text to remove from the subset", "string"},
747 {"text+", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_text, "Specify text to include in the subset", "string"},
750 {"text-file", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_file_for<parse_text, false>,"Specify file to read text from", "filename"},
751 {"unicodes", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_unicodes,
752 "Specify Unicode codepoints or ranges to include in the subset. Use * to include all codepoints.\n"
754 "--unicodes-=... can be used to subtract codepoints from the current set.\n"
756 "For example: --unicodes=* --unicodes-=41,42,43 would create a subset with all codepoints\n"
758 "except for 41, 42, 43.",
759 "list of hex numbers/ranges or *"},
760 {"unicodes-", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_unicodes, "Specify Unicode codepoints or ranges to remove from the subset", "list of hex numbers/ranges or *"},
761 {"unicodes+", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_unicodes, "Specify Unicode codepoints or ranges to include in the subset", "list of hex numbers/ranges or *"},
763 {"unicodes-file", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_file_for<parse_unicodes>,"Specify file to read Unicode codepoints or ranges from", "filename"},
766 add_group (glyphset_entries,
768 "Subset glyph-set option:",
769 "Subsetting glyph-set options",
772 GOptionEntry other_entries[] =
774 {"name-IDs", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_nameids, "Subset specified nameids. Use --name-IDs-=... to substract from the current set.", "list of int numbers or *"},
775 {"name-IDs-", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_nameids, "Subset specified nameids", "list of int numbers or *"},
776 {"name-IDs+", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_nameids, "Subset specified nameids", "list of int numbers or *"},
777 {"name-languages", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_name_languages, "Subset nameRecords with specified language IDs. Use --name-languages-=... to substract from the current set.", "list of int numbers or *"},
778 {"name-languages-", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_name_languages, "Subset nameRecords with specified language IDs", "list of int numbers or *"},
779 {"name-languages+", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_name_languages, "Subset nameRecords with specified language IDs", "list of int numbers or *"},
780 {"layout-features", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_layout_features, "Specify set of layout feature tags that will be preserved. Use --layout-features-=... to substract from the current set.", "list of string table tags or *"},
781 {"layout-features+",0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_layout_features, "Specify set of layout feature tags that will be preserved", "list of string table tags or *"},
782 {"layout-features-",0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_layout_features, "Specify set of layout feature tags that will be preserved", "list of string table tags or *"},
783 {"drop-tables", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_drop_tables, "Drop the specified tables. Use --drop-tables-=... to substract from the current set.", "list of string table tags or *"},
784 {"drop-tables+", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_drop_tables, "Drop the specified tables.", "list of string table tags or *"},
785 {"drop-tables-", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (gpointer) &parse_drop_tables, "Drop the specified tables.", "list of string table tags or *"},
788 add_group (other_entries,
790 "Subset other option:",
791 "Subsetting other options",
794 GOptionEntry flag_entries[] =
796 {"no-hinting", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_NO_HINTING>, "Whether to drop hints", nullptr},
797 {"retain-gids", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_RETAIN_GIDS>, "If set don't renumber glyph ids in the subset.", nullptr},
798 {"desubroutinize", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_DESUBROUTINIZE>, "Remove CFF/CFF2 use of subroutines", nullptr},
799 {"name-legacy", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_NAME_LEGACY>, "Keep legacy (non-Unicode) 'name' table entries", nullptr},
800 {"set-overlaps-flag", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_SET_OVERLAPS_FLAG>, "Set the overlaps flag on each glyph.", nullptr},
801 {"notdef-outline", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_NOTDEF_OUTLINE>, "Keep the outline of \'.notdef\' glyph", nullptr},
802 {"no-prune-unicode-ranges", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES>, "Don't change the 'OS/2 ulUnicodeRange*' bits.", nullptr},
803 {"glyph-names", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag<HB_SUBSET_FLAGS_GLYPH_NAMES>, "Keep PS glyph names in TT-flavored fonts. ", nullptr},
806 add_group (flag_entries,
808 "Subset boolean option:",
809 "Subsetting boolean options",
812 GOptionEntry app_entries[] =
814 {"num-iterations", 'n', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_INT,
815 &this->num_iterations,
816 "Run subsetter N times (default: 1)", "N"},
819 add_group (app_entries,
821 "Subset app option:",
822 "Subsetting application options",
825 output_options_t::add_options (this);
827 GOptionEntry entries[] =
829 {G_OPTION_REMAINING, 0, G_OPTION_FLAG_IN_MAIN,
830 G_OPTION_ARG_CALLBACK, (gpointer) &collect_rest, nullptr, "[FONT-FILE] [TEXT]"},
833 add_main_group (entries, this);
834 option_parser_t::add_options ();
838 main (int argc, char **argv)
840 return batch_main<subset_main_t, true> (argc, argv);