[subset] add option --no-prune-unicode-ranges
This commit is contained in:
parent
c3be28ea26
commit
eee7b459ee
|
@ -172,6 +172,7 @@ struct OS2
|
||||||
TRACE_SUBSET (this);
|
TRACE_SUBSET (this);
|
||||||
OS2 *os2_prime = c->serializer->embed (this);
|
OS2 *os2_prime = c->serializer->embed (this);
|
||||||
if (unlikely (!os2_prime)) return_trace (false);
|
if (unlikely (!os2_prime)) return_trace (false);
|
||||||
|
if (!c->plan->prune_unicode_ranges) return_trace (true);
|
||||||
|
|
||||||
hb_set_t unicodes;
|
hb_set_t unicodes;
|
||||||
if (!c->plan->glyphs_requested->is_empty ())
|
if (!c->plan->glyphs_requested->is_empty ())
|
||||||
|
|
|
@ -56,6 +56,7 @@ hb_subset_input_create_or_fail ()
|
||||||
input->name_legacy = false;
|
input->name_legacy = false;
|
||||||
input->overlaps_flag = false;
|
input->overlaps_flag = false;
|
||||||
input->notdef_outline = false;
|
input->notdef_outline = false;
|
||||||
|
input->no_prune_unicode_ranges = false;
|
||||||
input->retain_all_layout_features = false;
|
input->retain_all_layout_features = false;
|
||||||
|
|
||||||
hb_tag_t default_drop_tables[] = {
|
hb_tag_t default_drop_tables[] = {
|
||||||
|
@ -364,3 +365,16 @@ hb_subset_input_get_notdef_outline (hb_subset_input_t *subset_input)
|
||||||
return subset_input->notdef_outline;
|
return subset_input->notdef_outline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HB_EXTERN void
|
||||||
|
hb_subset_input_set_no_prune_unicode_ranges (hb_subset_input_t *subset_input,
|
||||||
|
hb_bool_t no_prune_unicode_ranges)
|
||||||
|
{
|
||||||
|
subset_input->no_prune_unicode_ranges = no_prune_unicode_ranges;
|
||||||
|
}
|
||||||
|
|
||||||
|
HB_EXTERN hb_bool_t
|
||||||
|
hb_subset_input_get_no_prune_unicode_ranges (hb_subset_input_t *subset_input)
|
||||||
|
{
|
||||||
|
return subset_input->no_prune_unicode_ranges;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ struct hb_subset_input_t
|
||||||
hb_bool_t name_legacy;
|
hb_bool_t name_legacy;
|
||||||
hb_bool_t overlaps_flag;
|
hb_bool_t overlaps_flag;
|
||||||
hb_bool_t notdef_outline;
|
hb_bool_t notdef_outline;
|
||||||
|
hb_bool_t no_prune_unicode_ranges;
|
||||||
hb_bool_t retain_all_layout_features;
|
hb_bool_t retain_all_layout_features;
|
||||||
/* TODO
|
/* TODO
|
||||||
*
|
*
|
||||||
|
|
|
@ -403,6 +403,7 @@ hb_subset_plan_create (hb_face_t *face,
|
||||||
plan->name_legacy = input->name_legacy;
|
plan->name_legacy = input->name_legacy;
|
||||||
plan->overlaps_flag = input->overlaps_flag;
|
plan->overlaps_flag = input->overlaps_flag;
|
||||||
plan->notdef_outline = input->notdef_outline;
|
plan->notdef_outline = input->notdef_outline;
|
||||||
|
plan->prune_unicode_ranges = !input->no_prune_unicode_ranges;
|
||||||
plan->retain_all_layout_features = input->retain_all_layout_features;
|
plan->retain_all_layout_features = input->retain_all_layout_features;
|
||||||
plan->unicodes = hb_set_create ();
|
plan->unicodes = hb_set_create ();
|
||||||
plan->name_ids = hb_set_reference (input->name_ids);
|
plan->name_ids = hb_set_reference (input->name_ids);
|
||||||
|
|
|
@ -46,6 +46,7 @@ struct hb_subset_plan_t
|
||||||
bool name_legacy : 1;
|
bool name_legacy : 1;
|
||||||
bool overlaps_flag : 1;
|
bool overlaps_flag : 1;
|
||||||
bool notdef_outline : 1;
|
bool notdef_outline : 1;
|
||||||
|
bool prune_unicode_ranges : 1;
|
||||||
bool retain_all_layout_features : 1;
|
bool retain_all_layout_features : 1;
|
||||||
|
|
||||||
// For each cp that we'd like to retain maps to the corresponding gid.
|
// For each cp that we'd like to retain maps to the corresponding gid.
|
||||||
|
|
|
@ -110,6 +110,13 @@ hb_subset_input_set_notdef_outline (hb_subset_input_t *subset_input,
|
||||||
HB_EXTERN hb_bool_t
|
HB_EXTERN hb_bool_t
|
||||||
hb_subset_input_get_notdef_outline (hb_subset_input_t *subset_input);
|
hb_subset_input_get_notdef_outline (hb_subset_input_t *subset_input);
|
||||||
|
|
||||||
|
HB_EXTERN void
|
||||||
|
hb_subset_input_set_no_prune_unicode_ranges (hb_subset_input_t *subset_input,
|
||||||
|
hb_bool_t no_prune_unicode_ranges);
|
||||||
|
|
||||||
|
HB_EXTERN hb_bool_t
|
||||||
|
hb_subset_input_get_no_prune_unicode_ranges (hb_subset_input_t *subset_input);
|
||||||
|
|
||||||
/* hb_subset () */
|
/* hb_subset () */
|
||||||
HB_EXTERN hb_face_t *
|
HB_EXTERN hb_face_t *
|
||||||
hb_subset (hb_face_t *source, hb_subset_input_t *input);
|
hb_subset (hb_face_t *source, hb_subset_input_t *input);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
--no-prune-unicode-ranges
|
|
@ -15,6 +15,7 @@ name-legacy.txt
|
||||||
gids.txt
|
gids.txt
|
||||||
layout-features.txt
|
layout-features.txt
|
||||||
keep-all-layout-features.txt
|
keep-all-layout-features.txt
|
||||||
|
no-prune-unicode-ranges.txt
|
||||||
|
|
||||||
SUBSETS:
|
SUBSETS:
|
||||||
abc
|
abc
|
||||||
|
|
|
@ -311,6 +311,7 @@ subset_options_t::add_options (option_parser_t *parser)
|
||||||
{"set-overlaps-flag", 0, 0, G_OPTION_ARG_NONE, &this->input->overlaps_flag,
|
{"set-overlaps-flag", 0, 0, G_OPTION_ARG_NONE, &this->input->overlaps_flag,
|
||||||
"Set the overlaps flag on each glyph.", nullptr},
|
"Set the overlaps flag on each glyph.", nullptr},
|
||||||
{"notdef-outline", 0, 0, G_OPTION_ARG_NONE, &this->input->notdef_outline, "Keep the outline of \'.notdef\' glyph", nullptr},
|
{"notdef-outline", 0, 0, G_OPTION_ARG_NONE, &this->input->notdef_outline, "Keep the outline of \'.notdef\' glyph", nullptr},
|
||||||
|
{"no-prune-unicode-ranges", 0, 0, G_OPTION_ARG_NONE, &this->input->no_prune_unicode_ranges, "Don't change the 'OS/2 ulUnicodeRange*' bits.", nullptr},
|
||||||
{nullptr}
|
{nullptr}
|
||||||
};
|
};
|
||||||
parser->add_group (entries,
|
parser->add_group (entries,
|
||||||
|
|
Loading…
Reference in New Issue