hb-subset-plan-member-list.hh (7597B)
1 /* 2 * Copyright © 2018 Google, Inc. 3 * Copyright © 2023 Behdad Esfahbod 4 * 5 * This is part of HarfBuzz, a text shaping library. 6 * 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. 12 * 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 17 * DAMAGE. 18 * 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. 24 * 25 * Google Author(s): Garret Rieger, Roderick Sheeter 26 */ 27 28 #ifndef HB_SUBSET_PLAN_MEMBER_LIST_HH 29 #define HB_SUBSET_PLAN_MEMBER_LIST_HH 30 #endif /* HB_SUBSET_PLAN_MEMBER_LIST_HH */ /* Dummy header guards */ 31 32 #define E(x, y) x, y 33 34 // For each cp that we'd like to retain maps to the corresponding gid. 35 HB_SUBSET_PLAN_MEMBER (hb_set_t, unicodes) 36 HB_SUBSET_PLAN_MEMBER (hb_sorted_vector_t<hb_codepoint_pair_t>, unicode_to_new_gid_list) 37 38 HB_SUBSET_PLAN_MEMBER (hb_sorted_vector_t<hb_codepoint_pair_t>, new_to_old_gid_list) 39 40 // name_ids we would like to retain 41 HB_SUBSET_PLAN_MEMBER (hb_set_t, name_ids) 42 43 // name_languages we would like to retain 44 HB_SUBSET_PLAN_MEMBER (hb_set_t, name_languages) 45 46 //layout features which will be preserved 47 HB_SUBSET_PLAN_MEMBER (hb_set_t, layout_features) 48 49 // layout scripts which will be preserved. 50 HB_SUBSET_PLAN_MEMBER (hb_set_t, layout_scripts) 51 52 //glyph ids requested to retain 53 HB_SUBSET_PLAN_MEMBER (hb_set_t, glyphs_requested) 54 55 // Tables which should not be processed, just pass them through. 56 HB_SUBSET_PLAN_MEMBER (hb_set_t, no_subset_tables) 57 58 // Tables which should be dropped. 59 HB_SUBSET_PLAN_MEMBER (hb_set_t, drop_tables) 60 61 // Old -> New glyph id mapping 62 HB_SUBSET_PLAN_MEMBER (hb_map_t, glyph_map_gsub) 63 64 HB_SUBSET_PLAN_MEMBER (hb_set_t, _glyphset) 65 HB_SUBSET_PLAN_MEMBER (hb_set_t, _glyphset_gsub) 66 HB_SUBSET_PLAN_MEMBER (hb_set_t, _glyphset_mathed) 67 HB_SUBSET_PLAN_MEMBER (hb_set_t, _glyphset_colred) 68 69 //active lookups we'd like to retain 70 HB_SUBSET_PLAN_MEMBER (hb_map_t, gsub_lookups) 71 HB_SUBSET_PLAN_MEMBER (hb_map_t, gpos_lookups) 72 73 //use_mark_sets mapping: old->new 74 HB_SUBSET_PLAN_MEMBER (hb_map_t, used_mark_sets_map) 75 76 //active langsys we'd like to retain 77 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::unique_ptr<hb_set_t>>), gsub_langsys) 78 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::unique_ptr<hb_set_t>>), gpos_langsys) 79 80 //active features after removing redundant langsys and prune_features 81 HB_SUBSET_PLAN_MEMBER (hb_map_t, gsub_features) 82 HB_SUBSET_PLAN_MEMBER (hb_map_t, gpos_features) 83 84 //active features(with duplicates) old index -> new index mapping 85 HB_SUBSET_PLAN_MEMBER (hb_map_t, gsub_features_w_duplicates) 86 HB_SUBSET_PLAN_MEMBER (hb_map_t, gpos_features_w_duplicates) 87 88 //active feature variation records/condition index with variations 89 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::shared_ptr<hb_set_t>>), gsub_feature_record_cond_idx_map) 90 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::shared_ptr<hb_set_t>>), gpos_feature_record_cond_idx_map) 91 92 //feature index-> address of substituation feature table mapping with 93 //variations 94 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, const OT::Feature*>), gsub_feature_substitutes_map) 95 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, const OT::Feature*>), gpos_feature_substitutes_map) 96 97 // old feature_indexes set, used to reinstate the old features 98 HB_SUBSET_PLAN_MEMBER (hb_set_t, gsub_old_features) 99 HB_SUBSET_PLAN_MEMBER (hb_set_t, gpos_old_features) 100 101 //feature_index->pair of (address of old feature, feature tag), used for inserting a catch all record 102 //if necessary 103 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb_pair_t E(<const void*, const void*>)>), gsub_old_feature_idx_tag_map) 104 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb_pair_t E(<const void*, const void*>)>), gpos_old_feature_idx_tag_map) 105 106 //active layers/palettes we'd like to retain 107 HB_SUBSET_PLAN_MEMBER (hb_map_t, colrv1_layers) 108 HB_SUBSET_PLAN_MEMBER (hb_map_t, colr_palettes) 109 //colrv1 varstore retained varidx mapping 110 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, colrv1_varstore_inner_maps) 111 //colrv1 retained varidx -> (new varidx, delta) mapping 112 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), colrv1_variation_idx_delta_map) 113 //colrv1 retained new delta set index -> new varidx mapping 114 HB_SUBSET_PLAN_MEMBER (hb_map_t, colrv1_new_deltaset_idx_varidx_map) 115 116 //Old layout item variation index -> (New varidx, delta) mapping 117 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), layout_variation_idx_delta_map) 118 119 //gdef varstore retained varidx mapping 120 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, gdef_varstore_inner_maps) 121 122 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, hb::unique_ptr<hb_blob_t>>), sanitized_table_cache) 123 124 //normalized axes range map 125 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, Triple>), axes_location) 126 HB_SUBSET_PLAN_MEMBER (hb_vector_t<int>, normalized_coords) 127 128 //user specified axes range map 129 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, Triple>), user_axes_location) 130 //axis->TripleDistances map (distances in the pre-normalized space) 131 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, TripleDistances>), axes_triple_distances) 132 133 //retained old axis index -> new axis index mapping in fvar axis array 134 HB_SUBSET_PLAN_MEMBER (hb_map_t, axes_index_map) 135 136 //axis_index->axis_tag mapping in fvar axis array 137 HB_SUBSET_PLAN_MEMBER (hb_map_t, axes_old_index_tag_map) 138 //vector of retained axis tags in the order of axes given in the 'fvar' table 139 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_tag_t>, axis_tags) 140 141 //hmtx metrics map: new gid->(advance, lsb) 142 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, hb_pair_t E(<unsigned, int>)>), hmtx_map) 143 //vmtx metrics map: new gid->(advance, lsb) 144 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, hb_pair_t E(<unsigned, int>)>), vmtx_map) 145 //boundsWidth map: new gid->boundsWidth, boundWidth=xMax - xMin 146 HB_SUBSET_PLAN_MEMBER (mutable hb_vector_t<unsigned>, bounds_width_vec) 147 //boundsHeight map: new gid->boundsHeight, boundsHeight=yMax - yMin 148 HB_SUBSET_PLAN_MEMBER (mutable hb_vector_t<unsigned>, bounds_height_vec) 149 150 //map: new_gid -> contour points vector 151 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, contour_point_vector_t>), new_gid_contour_points_map) 152 153 //new gids set for composite glyphs 154 HB_SUBSET_PLAN_MEMBER (hb_set_t, composite_new_gids) 155 156 //Old BASE item variation index -> (New varidx, 0) mapping 157 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), base_variation_idx_map) 158 159 //BASE table varstore retained varidx mapping 160 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, base_varstore_inner_maps) 161 162 #ifdef HB_EXPERIMENTAL_API 163 // name table overrides map: hb_ot_name_record_ids_t-> name string new value or 164 // None to indicate should remove 165 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_ot_name_record_ids_t, hb_bytes_t>), name_table_overrides) 166 #endif 167 168 #undef E