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 feature variation records/condition index with variations 85 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::shared_ptr<hb_set_t>>), gsub_feature_record_cond_idx_map) 86 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::shared_ptr<hb_set_t>>), gpos_feature_record_cond_idx_map) 87 88 //feature index-> address of substituation feature table mapping with 89 //variations 90 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, const OT::Feature*>), gsub_feature_substitutes_map) 91 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, const OT::Feature*>), gpos_feature_substitutes_map) 92 93 // old feature_indexes set, used to reinstate the old features 94 HB_SUBSET_PLAN_MEMBER (hb_set_t, gsub_old_features) 95 HB_SUBSET_PLAN_MEMBER (hb_set_t, gpos_old_features) 96 97 //feature_index->pair of (address of old feature, feature tag), used for inserting a catch all record 98 //if necessary 99 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb_pair_t E(<const void*, const void*>)>), gsub_old_feature_idx_tag_map) 100 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb_pair_t E(<const void*, const void*>)>), gpos_old_feature_idx_tag_map) 101 102 //active layers/palettes we'd like to retain 103 HB_SUBSET_PLAN_MEMBER (hb_map_t, colrv1_layers) 104 HB_SUBSET_PLAN_MEMBER (hb_map_t, colr_palettes) 105 //colrv1 varstore retained varidx mapping 106 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, colrv1_varstore_inner_maps) 107 //colrv1 retained varidx -> (new varidx, delta) mapping 108 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), colrv1_variation_idx_delta_map) 109 //colrv1 retained new delta set index -> new varidx mapping 110 HB_SUBSET_PLAN_MEMBER (hb_map_t, colrv1_new_deltaset_idx_varidx_map) 111 112 //Old layout item variation index -> (New varidx, delta) mapping 113 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), layout_variation_idx_delta_map) 114 115 //gdef varstore retained varidx mapping 116 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, gdef_varstore_inner_maps) 117 118 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, hb::unique_ptr<hb_blob_t>>), sanitized_table_cache) 119 120 //normalized axes range map 121 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, Triple>), axes_location) 122 HB_SUBSET_PLAN_MEMBER (hb_vector_t<int>, normalized_coords) 123 124 //user specified axes range map 125 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, Triple>), user_axes_location) 126 //axis->TripleDistances map (distances in the pre-normalized space) 127 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, TripleDistances>), axes_triple_distances) 128 129 //retained old axis index -> new axis index mapping in fvar axis array 130 HB_SUBSET_PLAN_MEMBER (hb_map_t, axes_index_map) 131 132 //axis_index->axis_tag mapping in fvar axis array 133 HB_SUBSET_PLAN_MEMBER (hb_map_t, axes_old_index_tag_map) 134 //vector of retained axis tags in the order of axes given in the 'fvar' table 135 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_tag_t>, axis_tags) 136 137 //hmtx metrics map: new gid->(advance, lsb) 138 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, hb_pair_t E(<unsigned, int>)>), hmtx_map) 139 //vmtx metrics map: new gid->(advance, lsb) 140 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, hb_pair_t E(<unsigned, int>)>), vmtx_map) 141 //boundsWidth map: new gid->boundsWidth, boundWidth=xMax - xMin 142 HB_SUBSET_PLAN_MEMBER (mutable hb_vector_t<unsigned>, bounds_width_vec) 143 //boundsHeight map: new gid->boundsHeight, boundsHeight=yMax - yMin 144 HB_SUBSET_PLAN_MEMBER (mutable hb_vector_t<unsigned>, bounds_height_vec) 145 146 //map: new_gid -> contour points vector 147 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, contour_point_vector_t>), new_gid_contour_points_map) 148 149 //new gids set for composite glyphs 150 HB_SUBSET_PLAN_MEMBER (hb_set_t, composite_new_gids) 151 152 //Old BASE item variation index -> (New varidx, 0) mapping 153 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), base_variation_idx_map) 154 155 //BASE table varstore retained varidx mapping 156 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, base_varstore_inner_maps) 157 158 #ifdef HB_EXPERIMENTAL_API 159 // name table overrides map: hb_ot_name_record_ids_t-> name string new value or 160 // None to indicate should remove 161 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_ot_name_record_ids_t, hb_bytes_t>), name_table_overrides) 162 #endif 163 164 #undef E 165