[subset] add --hinting flag
This commit is contained in:
parent
7ecca8c0a8
commit
0bd100e144
|
@ -43,6 +43,7 @@ struct hb_subset_input_t {
|
|||
hb_set_t *unicodes;
|
||||
hb_set_t *glyphs;
|
||||
|
||||
hb_bool_t retain_hints;
|
||||
/* TODO
|
||||
*
|
||||
* features
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "main-font-text.hh"
|
||||
#include "hb-subset.h"
|
||||
#include "hb-subset-private.hh"
|
||||
|
||||
/*
|
||||
* Command line interface to the harfbuzz font subsetter.
|
||||
|
@ -37,7 +38,7 @@
|
|||
struct subset_consumer_t
|
||||
{
|
||||
subset_consumer_t (option_parser_t *parser)
|
||||
: failed (false), options (parser), font (nullptr), input (nullptr) {}
|
||||
: failed (false), options (parser), subset_options (parser), font (nullptr), input (nullptr) {}
|
||||
|
||||
void init (hb_buffer_t *buffer_,
|
||||
const font_options_t *font_opts)
|
||||
|
@ -89,6 +90,8 @@ struct subset_consumer_t
|
|||
|
||||
void finish (const font_options_t *font_opts)
|
||||
{
|
||||
input->retain_hints = subset_options.hinting;
|
||||
|
||||
hb_subset_profile_t *subset_profile = hb_subset_profile_create();
|
||||
hb_face_t *face = hb_font_get_face (font);
|
||||
|
||||
|
@ -111,6 +114,7 @@ struct subset_consumer_t
|
|||
|
||||
private:
|
||||
output_options_t options;
|
||||
subset_options_t subset_options;
|
||||
hb_font_t *font;
|
||||
hb_subset_input_t *input;
|
||||
};
|
||||
|
|
|
@ -986,3 +986,18 @@ format_options_t::serialize_buffer_of_glyphs (hb_buffer_t *buffer,
|
|||
serialize_glyphs (buffer, font, output_format, format_flags, gs);
|
||||
g_string_append_c (gs, '\n');
|
||||
}
|
||||
|
||||
void
|
||||
subset_options_t::add_options (option_parser_t *parser)
|
||||
{
|
||||
GOptionEntry entries[] =
|
||||
{
|
||||
{"hinting", 0, 0, G_OPTION_ARG_NONE, &this->hinting, "Whether to retain or drop hints", nullptr},
|
||||
{nullptr}
|
||||
};
|
||||
parser->add_group (entries,
|
||||
"subset",
|
||||
"Subset options:",
|
||||
"Options subsetting",
|
||||
this);
|
||||
}
|
||||
|
|
|
@ -649,6 +649,20 @@ struct format_options_t : option_group_t
|
|||
hb_bool_t trace;
|
||||
};
|
||||
|
||||
struct subset_options_t : option_group_t
|
||||
{
|
||||
subset_options_t (option_parser_t *parser)
|
||||
{
|
||||
hinting = true;
|
||||
|
||||
add_options (parser);
|
||||
}
|
||||
|
||||
void add_options (option_parser_t *parser);
|
||||
|
||||
hb_bool_t hinting;
|
||||
};
|
||||
|
||||
/* fallback implementation for scalbn()/scalbnf() for pre-2013 MSVC */
|
||||
#if defined (_MSC_VER) && (_MSC_VER < 1800)
|
||||
|
||||
|
|
Loading…
Reference in New Issue