From 792e2ed61c14ba850e7ffcedbddc107947394014 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Thu, 22 Jul 2021 12:41:48 -0700 Subject: [PATCH] [subset] convert no get/set prune unicode ranges to enum. --- src/hb-subset-input.cc | 45 ++++++------------------------------------ src/hb-subset.h | 26 +++--------------------- 2 files changed, 9 insertions(+), 62 deletions(-) diff --git a/src/hb-subset-input.cc b/src/hb-subset-input.cc index fffea6037..cca41a149 100644 --- a/src/hb-subset-input.cc +++ b/src/hb-subset-input.cc @@ -374,6 +374,8 @@ hb_subset_input_get_flag (hb_subset_input_t *input, return input->passthrough_unrecognized; case HB_SUBSET_FLAG_NOTDEF_OUTLINE: return input->notdef_outline; + case HB_SUBSET_FLAG_NO_PRUNE_UNICODE_RANGES: + return input->no_prune_unicode_ranges; default: return false; } @@ -416,51 +418,16 @@ hb_subset_input_set_flag (hb_subset_input_t *input, break; case HB_SUBSET_FLAG_NOTDEF_OUTLINE: input->notdef_outline = value; + break; + case HB_SUBSET_FLAG_NO_PRUNE_UNICODE_RANGES: + input->no_prune_unicode_ranges = value; + break; default: // Do nothing. break; } } -HB_EXTERN void -hb_subset_input_set_overlaps_flag (hb_subset_input_t *subset_input, - hb_bool_t overlaps_flag) -{ - subset_input->overlaps_flag = overlaps_flag; -} - -HB_EXTERN hb_bool_t -hb_subset_input_get_overlaps_flag (hb_subset_input_t *subset_input) -{ - return subset_input->overlaps_flag; -} - -HB_EXTERN void -hb_subset_input_set_notdef_outline (hb_subset_input_t *subset_input, - hb_bool_t notdef_outline) -{ - subset_input->notdef_outline = notdef_outline; -} - -HB_EXTERN hb_bool_t -hb_subset_input_get_notdef_outline (hb_subset_input_t *subset_input) -{ - 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; -} - /** * hb_subset_input_set_user_data: (skip) * @input: A subset input object diff --git a/src/hb-subset.h b/src/hb-subset.h index 04146e025..c8a540cd9 100644 --- a/src/hb-subset.h +++ b/src/hb-subset.h @@ -59,6 +59,8 @@ typedef struct hb_subset_input_t hb_subset_input_t; * Defaults to false. * @HB_SUBSET_FLAG_NOTDEF_OUTLINE: If set the notdef glyph outline will be * retained in the final subset. Defaults to false. + * @HB_SUBSET_FLAG_NO_PRUNE_UNICODE_RANGES: If set then the unicode ranges in + * OS/2 will not be recalculated. * * List of boolean properties that can be configured on the subset input. * @@ -73,6 +75,7 @@ typedef enum HB_SUBSET_FLAG_SET_OVERLAPS_FLAG, HB_SUBSET_FLAG_PASSTHROUGH_UNRECOGNIZED, HB_SUBSET_FLAG_NOTDEF_OUTLINE, + HB_SUBSET_FLAG_NO_PRUNE_UNICODE_RANGES, } hb_subset_flag_t; HB_EXTERN hb_subset_input_t * @@ -131,29 +134,6 @@ hb_subset_input_set_flag (hb_subset_input_t *input, hb_subset_flag_t flag, hb_bool_t value); -// TODO(garretrieger): remove bool property get/set methods. - -HB_EXTERN void -hb_subset_input_set_overlaps_flag (hb_subset_input_t *subset_input, - hb_bool_t overlaps_flag); - -HB_EXTERN hb_bool_t -hb_subset_input_get_overlaps_flag (hb_subset_input_t *subset_input); - -HB_EXTERN void -hb_subset_input_set_notdef_outline (hb_subset_input_t *subset_input, - hb_bool_t notdef_outline); - -HB_EXTERN hb_bool_t -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_EXTERN hb_face_t * hb_subset (hb_face_t *source, const hb_subset_input_t *input);