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 //active langsys we'd like to retain 74 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::unique_ptr<hb_set_t>>), gsub_langsys) 75 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::unique_ptr<hb_set_t>>), gpos_langsys) 76 77 //active features after removing redundant langsys and prune_features 78 HB_SUBSET_PLAN_MEMBER (hb_map_t, gsub_features) 79 HB_SUBSET_PLAN_MEMBER (hb_map_t, gpos_features) 80 81 //active feature variation records/condition index with variations 82 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::shared_ptr<hb_set_t>>), gsub_feature_record_cond_idx_map) 83 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb::shared_ptr<hb_set_t>>), gpos_feature_record_cond_idx_map) 84 85 //feature index-> address of substituation feature table mapping with 86 //variations 87 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, const OT::Feature*>), gsub_feature_substitutes_map) 88 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, const OT::Feature*>), gpos_feature_substitutes_map) 89 90 //active layers/palettes we'd like to retain 91 HB_SUBSET_PLAN_MEMBER (hb_map_t, colrv1_layers) 92 HB_SUBSET_PLAN_MEMBER (hb_map_t, colr_palettes) 93 94 //Old layout item variation index -> (New varidx, delta) mapping 95 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), layout_variation_idx_delta_map) 96 97 //gdef varstore retained varidx mapping 98 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, gdef_varstore_inner_maps) 99 100 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, hb::unique_ptr<hb_blob_t>>), sanitized_table_cache) 101 102 //normalized axes range map 103 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, Triple>), axes_location) 104 HB_SUBSET_PLAN_MEMBER (hb_vector_t<int>, normalized_coords) 105 106 //user specified axes range map 107 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, Triple>), user_axes_location) 108 //axis->TripleDistances map (distances in the pre-normalized space) 109 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_tag_t, TripleDistances>), axes_triple_distances) 110 111 //retained old axis index -> new axis index mapping in fvar axis array 112 HB_SUBSET_PLAN_MEMBER (hb_map_t, axes_index_map) 113 114 //axis_index->axis_tag mapping in fvar axis array 115 HB_SUBSET_PLAN_MEMBER (hb_map_t, axes_old_index_tag_map) 116 //vector of retained axis tags in the order of axes given in the 'fvar' table 117 HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_tag_t>, axis_tags) 118 119 //hmtx metrics map: new gid->(advance, lsb) 120 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, hb_pair_t E(<unsigned, int>)>), hmtx_map) 121 //vmtx metrics map: new gid->(advance, lsb) 122 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, hb_pair_t E(<unsigned, int>)>), vmtx_map) 123 //boundsWidth map: new gid->boundsWidth, boundWidth=xMax - xMin 124 HB_SUBSET_PLAN_MEMBER (mutable hb_vector_t<unsigned>, bounds_width_vec) 125 //boundsHeight map: new gid->boundsHeight, boundsHeight=yMax - yMin 126 HB_SUBSET_PLAN_MEMBER (mutable hb_vector_t<unsigned>, bounds_height_vec) 127 128 //map: new_gid -> contour points vector 129 HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, contour_point_vector_t>), new_gid_contour_points_map) 130 131 #ifdef HB_EXPERIMENTAL_API 132 // name table overrides map: hb_ot_name_record_ids_t-> name string new value or 133 // None to indicate should remove 134 HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<hb_ot_name_record_ids_t, hb_bytes_t>), name_table_overrides) 135 #endif 136 137 #undef E 138