mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 18:44:09 +01:00
[subset] Add new subsetting API method to receive a user specified glyph mapping.
This commit is contained in:
1 parent
1be3972914
commit
e711e305c8
3 files changed
+22
No files matched your search
@@ -520,6 +520,22 @@ hb_subset_preprocess (hb_face_t *source)
|
||||
return new_source;
|
||||
}
|
||||
|
||||
HB_EXTERN hb_bool_t
|
||||
hb_subset_input_set_old_to_new_glyph_mapping (hb_subset_input_t *input,
|
||||
const hb_map_t* mapping)
|
||||
{
|
||||
hb_set_t new_gids;
|
||||
for (auto gid : mapping->values())
|
||||
{
|
||||
// Mapping cannot map multiple old gids to the same new gid.
|
||||
if (new_gids.has(gid)) return false;
|
||||
new_gids.add(gid);
|
||||
}
|
||||
|
||||
input->glyph_map = *mapping;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HB_EXPERIMENTAL_API
|
||||
/**
|
||||
* hb_subset_input_override_name_table:
|
||||
|
||||
@@ -119,6 +119,7 @@ struct hb_subset_input_t
|
||||
bool force_long_loca = false;
|
||||
|
||||
hb_hashmap_t<hb_tag_t, float> axes_location;
|
||||
hb_map_t glyph_map;
|
||||
#ifdef HB_EXPERIMENTAL_API
|
||||
hb_hashmap_t<hb_ot_name_record_ids_t, hb_bytes_t> name_table_overrides;
|
||||
#endif
|
||||
|
||||
@@ -172,6 +172,11 @@ hb_subset_input_pin_axis_location (hb_subset_input_t *input,
|
||||
hb_tag_t axis_tag,
|
||||
float axis_value);
|
||||
|
||||
HB_EXTERN hb_bool_t
|
||||
hb_subset_input_set_old_to_new_glyph_mapping (hb_subset_input_t *input,
|
||||
const hb_map_t* mapping);
|
||||
|
||||
|
||||
#ifdef HB_EXPERIMENTAL_API
|
||||
HB_EXTERN hb_bool_t
|
||||
hb_subset_input_override_name_table (hb_subset_input_t *input,
|
||||
|
||||
Reference in new issue
Block a user