Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 1 | /* |
Behdad Esfahbod | 2409d5f | 2011-04-21 17:14:28 -0400 | [diff] [blame] | 2 | * Copyright © 2009,2010 Red Hat, Inc. |
Behdad Esfahbod | 06a44e8 | 2013-04-21 15:13:08 -0400 | [diff] [blame] | 3 | * Copyright © 2010,2011,2012,2013 Google, Inc. |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 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 | * Red Hat Author(s): Behdad Esfahbod |
| 26 | * Google Author(s): Behdad Esfahbod |
| 27 | */ |
| 28 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 29 | #ifndef HB_OT_MAP_HH |
| 30 | #define HB_OT_MAP_HH |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 31 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 32 | #include "hb-buffer.hh" |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 33 | |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 34 | |
Behdad Esfahbod | 71c9f84 | 2018-09-10 22:37:19 +0200 | [diff] [blame] | 35 | #define HB_OT_MAP_MAX_BITS 8u |
| 36 | #define HB_OT_MAP_MAX_VALUE ((1u << HB_OT_MAP_MAX_BITS) - 1u) |
| 37 | |
Behdad Esfahbod | 2265be0 | 2013-05-02 14:25:09 -0400 | [diff] [blame] | 38 | struct hb_ot_shape_plan_t; |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 39 | |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 40 | static const hb_tag_t table_tags[2] = {HB_OT_TAG_GSUB, HB_OT_TAG_GPOS}; |
| 41 | |
Behdad Esfahbod | 90645fb | 2011-05-27 18:13:31 -0400 | [diff] [blame] | 42 | struct hb_ot_map_t |
| 43 | { |
| 44 | friend struct hb_ot_map_builder_t; |
| 45 | |
| 46 | public: |
| 47 | |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 48 | struct feature_map_t { |
| 49 | hb_tag_t tag; /* should be first for our bsearch to work */ |
Behdad Esfahbod | b70c96d | 2011-07-07 21:07:41 -0400 | [diff] [blame] | 50 | unsigned int index[2]; /* GSUB/GPOS */ |
| 51 | unsigned int stage[2]; /* GSUB/GPOS */ |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 52 | unsigned int shift; |
| 53 | hb_mask_t mask; |
Behdad Esfahbod | 39dede9 | 2010-10-13 15:54:06 -0400 | [diff] [blame] | 54 | hb_mask_t _1_mask; /* mask for value=1, for quick access */ |
Behdad Esfahbod | cfc507c | 2013-02-14 10:40:12 -0500 | [diff] [blame] | 55 | unsigned int needs_fallback : 1; |
Behdad Esfahbod | cdf1fd0 | 2017-07-14 12:43:34 +0100 | [diff] [blame] | 56 | unsigned int auto_zwnj : 1; |
Behdad Esfahbod | a8cf7b4 | 2013-03-19 05:53:26 -0400 | [diff] [blame] | 57 | unsigned int auto_zwj : 1; |
David Corbett | f05df64 | 2018-01-26 21:36:15 -0500 | [diff] [blame] | 58 | unsigned int random : 1; |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 59 | |
Behdad Esfahbod | db5f7ef | 2017-10-15 16:00:22 +0200 | [diff] [blame] | 60 | inline int cmp (const hb_tag_t *tag_) const |
| 61 | { return *tag_ < tag ? -1 : *tag_ > tag ? 1 : 0; } |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | struct lookup_map_t { |
Behdad Esfahbod | cfc507c | 2013-02-14 10:40:12 -0500 | [diff] [blame] | 65 | unsigned short index; |
Behdad Esfahbod | cdf1fd0 | 2017-07-14 12:43:34 +0100 | [diff] [blame] | 66 | unsigned short auto_zwnj : 1; |
Behdad Esfahbod | a8cf7b4 | 2013-03-19 05:53:26 -0400 | [diff] [blame] | 67 | unsigned short auto_zwj : 1; |
David Corbett | c2a75e0 | 2018-01-25 14:22:03 -0500 | [diff] [blame] | 68 | unsigned short random : 1; |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 69 | hb_mask_t mask; |
| 70 | |
Behdad Esfahbod | 0712e91 | 2017-10-29 17:01:47 -0600 | [diff] [blame] | 71 | static int cmp (const void *pa, const void *pb) |
| 72 | { |
| 73 | const lookup_map_t *a = (const lookup_map_t *) pa; |
| 74 | const lookup_map_t *b = (const lookup_map_t *) pb; |
| 75 | return a->index < b->index ? -1 : a->index > b->index ? 1 : 0; |
| 76 | } |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 77 | }; |
| 78 | |
Behdad Esfahbod | 8bb5deb | 2012-08-02 10:07:58 -0400 | [diff] [blame] | 79 | typedef void (*pause_func_t) (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer); |
Behdad Esfahbod | b70c96d | 2011-07-07 21:07:41 -0400 | [diff] [blame] | 80 | |
Behdad Esfahbod | 8ac3c9c | 2013-04-21 15:19:38 -0400 | [diff] [blame] | 81 | struct stage_map_t { |
Behdad Esfahbod | 893f57b | 2013-04-21 15:21:49 -0400 | [diff] [blame] | 82 | unsigned int last_lookup; /* Cumulative */ |
| 83 | pause_func_t pause_func; |
Behdad Esfahbod | b70c96d | 2011-07-07 21:07:41 -0400 | [diff] [blame] | 84 | }; |
| 85 | |
Behdad Esfahbod | f9abbf8 | 2018-06-02 15:30:59 -0700 | [diff] [blame] | 86 | inline void init (void) |
| 87 | { |
| 88 | memset (this, 0, sizeof (*this)); |
| 89 | |
| 90 | features.init (); |
| 91 | for (unsigned int table_index = 0; table_index < 2; table_index++) |
| 92 | { |
| 93 | lookups[table_index].init (); |
| 94 | stages[table_index].init (); |
| 95 | } |
| 96 | } |
| 97 | inline void fini (void) |
| 98 | { |
| 99 | features.fini (); |
| 100 | for (unsigned int table_index = 0; table_index < 2; table_index++) |
| 101 | { |
| 102 | lookups[table_index].fini (); |
| 103 | stages[table_index].fini (); |
| 104 | } |
| 105 | } |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 106 | |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 107 | inline hb_mask_t get_global_mask (void) const { return global_mask; } |
| 108 | |
Behdad Esfahbod | dbdbfe3 | 2017-10-15 12:11:08 +0200 | [diff] [blame] | 109 | inline hb_mask_t get_mask (hb_tag_t feature_tag, unsigned int *shift = nullptr) const { |
Behdad Esfahbod | c479a59 | 2018-02-07 21:13:10 -0600 | [diff] [blame] | 110 | const feature_map_t *map = features.bsearch (feature_tag); |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 111 | if (shift) *shift = map ? map->shift : 0; |
| 112 | return map ? map->mask : 0; |
| 113 | } |
| 114 | |
Behdad Esfahbod | fabd311 | 2012-09-05 22:19:28 -0400 | [diff] [blame] | 115 | inline bool needs_fallback (hb_tag_t feature_tag) const { |
Behdad Esfahbod | c479a59 | 2018-02-07 21:13:10 -0600 | [diff] [blame] | 116 | const feature_map_t *map = features.bsearch (feature_tag); |
Behdad Esfahbod | fabd311 | 2012-09-05 22:19:28 -0400 | [diff] [blame] | 117 | return map ? map->needs_fallback : false; |
| 118 | } |
| 119 | |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 120 | inline hb_mask_t get_1_mask (hb_tag_t feature_tag) const { |
Behdad Esfahbod | c479a59 | 2018-02-07 21:13:10 -0600 | [diff] [blame] | 121 | const feature_map_t *map = features.bsearch (feature_tag); |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 122 | return map ? map->_1_mask : 0; |
| 123 | } |
| 124 | |
| 125 | inline unsigned int get_feature_index (unsigned int table_index, hb_tag_t feature_tag) const { |
Behdad Esfahbod | c479a59 | 2018-02-07 21:13:10 -0600 | [diff] [blame] | 126 | const feature_map_t *map = features.bsearch (feature_tag); |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 127 | return map ? map->index[table_index] : HB_OT_LAYOUT_NO_FEATURE_INDEX; |
| 128 | } |
| 129 | |
| 130 | inline unsigned int get_feature_stage (unsigned int table_index, hb_tag_t feature_tag) const { |
Behdad Esfahbod | c479a59 | 2018-02-07 21:13:10 -0600 | [diff] [blame] | 131 | const feature_map_t *map = features.bsearch (feature_tag); |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 132 | return map ? map->stage[table_index] : (unsigned int) -1; |
| 133 | } |
| 134 | |
| 135 | inline void get_stage_lookups (unsigned int table_index, unsigned int stage, |
| 136 | const struct lookup_map_t **plookups, unsigned int *lookup_count) const { |
| 137 | if (unlikely (stage == (unsigned int) -1)) { |
Behdad Esfahbod | dbdbfe3 | 2017-10-15 12:11:08 +0200 | [diff] [blame] | 138 | *plookups = nullptr; |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 139 | *lookup_count = 0; |
| 140 | return; |
| 141 | } |
Behdad Esfahbod | 8ac3c9c | 2013-04-21 15:19:38 -0400 | [diff] [blame] | 142 | assert (stage <= stages[table_index].len); |
Behdad Esfahbod | 893f57b | 2013-04-21 15:21:49 -0400 | [diff] [blame] | 143 | unsigned int start = stage ? stages[table_index][stage - 1].last_lookup : 0; |
| 144 | unsigned int end = stage < stages[table_index].len ? stages[table_index][stage].last_lookup : lookups[table_index].len; |
Behdad Esfahbod | dbdbfe3 | 2017-10-15 12:11:08 +0200 | [diff] [blame] | 145 | *plookups = end == start ? nullptr : &lookups[table_index][start]; |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 146 | *lookup_count = end - start; |
| 147 | } |
| 148 | |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 149 | HB_INTERNAL void collect_lookups (unsigned int table_index, hb_set_t *lookups) const; |
Behdad Esfahbod | bac1dd6 | 2013-05-02 18:52:24 -0400 | [diff] [blame] | 150 | template <typename Proxy> |
| 151 | HB_INTERNAL inline void apply (const Proxy &proxy, |
| 152 | const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; |
Behdad Esfahbod | 8bb5deb | 2012-08-02 10:07:58 -0400 | [diff] [blame] | 153 | HB_INTERNAL void substitute (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; |
| 154 | HB_INTERNAL void position (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 155 | |
Behdad Esfahbod | 851784f | 2012-11-14 16:24:05 -0800 | [diff] [blame] | 156 | public: |
| 157 | hb_tag_t chosen_script[2]; |
| 158 | bool found_script[2]; |
Behdad Esfahbod | 610e5e8 | 2012-08-02 05:27:46 -0400 | [diff] [blame] | 159 | |
| 160 | private: |
| 161 | |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 162 | hb_mask_t global_mask; |
| 163 | |
Behdad Esfahbod | 5c3112a | 2018-05-01 19:07:04 -0400 | [diff] [blame] | 164 | hb_vector_t<feature_map_t, 8> features; |
| 165 | hb_vector_t<lookup_map_t, 32> lookups[2]; /* GSUB/GPOS */ |
| 166 | hb_vector_t<stage_map_t, 4> stages[2]; /* GSUB/GPOS */ |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 167 | }; |
| 168 | |
Behdad Esfahbod | ec54486 | 2013-02-14 11:25:10 -0500 | [diff] [blame] | 169 | enum hb_ot_map_feature_flags_t { |
Behdad Esfahbod | 7627100 | 2014-07-11 14:54:42 -0400 | [diff] [blame] | 170 | F_NONE = 0x0000u, |
Behdad Esfahbod | 0f98fe8 | 2015-07-23 11:52:11 +0100 | [diff] [blame] | 171 | F_GLOBAL = 0x0001u, /* Feature applies to all characters; results in no mask allocated for it. */ |
| 172 | F_HAS_FALLBACK = 0x0002u, /* Has fallback implementation, so include mask bit even if feature not found. */ |
Behdad Esfahbod | cdf1fd0 | 2017-07-14 12:43:34 +0100 | [diff] [blame] | 173 | F_MANUAL_ZWNJ = 0x0004u, /* Don't skip over ZWNJ when matching **context**. */ |
| 174 | F_MANUAL_ZWJ = 0x0008u, /* Don't skip over ZWJ when matching **input**. */ |
David Corbett | f05df64 | 2018-01-26 21:36:15 -0500 | [diff] [blame] | 175 | F_GLOBAL_SEARCH = 0x0010u, /* If feature not found in LangSys, look for it in global feature list and pick one. */ |
| 176 | F_RANDOM = 0x0020u /* Randomly select a glyph from an AlternateSubstFormat1 subtable. */ |
Behdad Esfahbod | ec54486 | 2013-02-14 11:25:10 -0500 | [diff] [blame] | 177 | }; |
Chun-wei Fan | 167c327 | 2015-11-09 17:17:56 +0800 | [diff] [blame] | 178 | HB_MARK_AS_FLAG_T (hb_ot_map_feature_flags_t); |
Behdad Esfahbod | 41732f1 | 2013-02-27 20:40:54 -0500 | [diff] [blame] | 179 | /* Macro version for where const is desired. */ |
| 180 | #define F_COMBINE(l,r) (hb_ot_map_feature_flags_t ((unsigned int) (l) | (unsigned int) (r))) |
Behdad Esfahbod | ec54486 | 2013-02-14 11:25:10 -0500 | [diff] [blame] | 181 | |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 182 | |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 183 | struct hb_ot_map_builder_t |
| 184 | { |
| 185 | public: |
| 186 | |
Behdad Esfahbod | 6fddf2d | 2012-11-12 17:57:24 -0800 | [diff] [blame] | 187 | HB_INTERNAL hb_ot_map_builder_t (hb_face_t *face_, |
| 188 | const hb_segment_properties_t *props_); |
Behdad Esfahbod | 8336186 | 2011-08-04 19:49:05 -0400 | [diff] [blame] | 189 | |
Behdad Esfahbod | f9abbf8 | 2018-06-02 15:30:59 -0700 | [diff] [blame] | 190 | HB_INTERNAL ~hb_ot_map_builder_t (void); |
| 191 | |
Behdad Esfahbod | ec54486 | 2013-02-14 11:25:10 -0500 | [diff] [blame] | 192 | HB_INTERNAL void add_feature (hb_tag_t tag, unsigned int value, |
| 193 | hb_ot_map_feature_flags_t flags); |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 194 | |
Behdad Esfahbod | e7ffcfa | 2013-02-14 11:05:56 -0500 | [diff] [blame] | 195 | inline void add_global_bool_feature (hb_tag_t tag) |
Behdad Esfahbod | ec54486 | 2013-02-14 11:25:10 -0500 | [diff] [blame] | 196 | { add_feature (tag, 1, F_GLOBAL); } |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 197 | |
Behdad Esfahbod | 3e38c0f | 2012-08-02 09:44:18 -0400 | [diff] [blame] | 198 | inline void add_gsub_pause (hb_ot_map_t::pause_func_t pause_func) |
| 199 | { add_pause (0, pause_func); } |
| 200 | inline void add_gpos_pause (hb_ot_map_t::pause_func_t pause_func) |
| 201 | { add_pause (1, pause_func); } |
Behdad Esfahbod | b70c96d | 2011-07-07 21:07:41 -0400 | [diff] [blame] | 202 | |
Behdad Esfahbod | 72ada4f | 2016-09-10 03:57:24 -0700 | [diff] [blame] | 203 | HB_INTERNAL void compile (hb_ot_map_t &m, |
| 204 | const int *coords, |
| 205 | unsigned int num_coords); |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 206 | |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 207 | private: |
| 208 | |
Behdad Esfahbod | 72ada4f | 2016-09-10 03:57:24 -0700 | [diff] [blame] | 209 | HB_INTERNAL void add_lookups (hb_ot_map_t &m, |
Behdad Esfahbod | 72ada4f | 2016-09-10 03:57:24 -0700 | [diff] [blame] | 210 | unsigned int table_index, |
| 211 | unsigned int feature_index, |
| 212 | unsigned int variations_index, |
| 213 | hb_mask_t mask, |
Behdad Esfahbod | cdf1fd0 | 2017-07-14 12:43:34 +0100 | [diff] [blame] | 214 | bool auto_zwnj = true, |
David Corbett | c2a75e0 | 2018-01-25 14:22:03 -0500 | [diff] [blame] | 215 | bool auto_zwj = true, |
| 216 | bool random = false); |
Behdad Esfahbod | bde5e39 | 2016-09-10 02:43:20 -0700 | [diff] [blame] | 217 | |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 218 | struct feature_info_t { |
| 219 | hb_tag_t tag; |
| 220 | unsigned int seq; /* sequence#, used for stable sorting only */ |
| 221 | unsigned int max_value; |
Behdad Esfahbod | ec54486 | 2013-02-14 11:25:10 -0500 | [diff] [blame] | 222 | hb_ot_map_feature_flags_t flags; |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 223 | unsigned int default_value; /* for non-global features, what should the unset glyphs take */ |
Behdad Esfahbod | b70c96d | 2011-07-07 21:07:41 -0400 | [diff] [blame] | 224 | unsigned int stage[2]; /* GSUB/GPOS */ |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 225 | |
Behdad Esfahbod | 0712e91 | 2017-10-29 17:01:47 -0600 | [diff] [blame] | 226 | static int cmp (const void *pa, const void *pb) |
| 227 | { |
| 228 | const feature_info_t *a = (const feature_info_t *) pa; |
| 229 | const feature_info_t *b = (const feature_info_t *) pb; |
| 230 | return (a->tag != b->tag) ? (a->tag < b->tag ? -1 : 1) : |
| 231 | (a->seq < b->seq ? -1 : a->seq > b->seq ? 1 : 0); |
| 232 | } |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 233 | }; |
| 234 | |
Behdad Esfahbod | 8ac3c9c | 2013-04-21 15:19:38 -0400 | [diff] [blame] | 235 | struct stage_info_t { |
| 236 | unsigned int index; |
Behdad Esfahbod | 893f57b | 2013-04-21 15:21:49 -0400 | [diff] [blame] | 237 | hb_ot_map_t::pause_func_t pause_func; |
Behdad Esfahbod | b70c96d | 2011-07-07 21:07:41 -0400 | [diff] [blame] | 238 | }; |
| 239 | |
Behdad Esfahbod | 3e38c0f | 2012-08-02 09:44:18 -0400 | [diff] [blame] | 240 | HB_INTERNAL void add_pause (unsigned int table_index, hb_ot_map_t::pause_func_t pause_func); |
Behdad Esfahbod | d8d0c48 | 2011-07-07 21:22:08 -0400 | [diff] [blame] | 241 | |
Behdad Esfahbod | 5ab3855 | 2012-11-12 18:27:42 -0800 | [diff] [blame] | 242 | public: |
| 243 | |
Behdad Esfahbod | 6fddf2d | 2012-11-12 17:57:24 -0800 | [diff] [blame] | 244 | hb_face_t *face; |
| 245 | hb_segment_properties_t props; |
| 246 | |
| 247 | hb_tag_t chosen_script[2]; |
Behdad Esfahbod | 851784f | 2012-11-14 16:24:05 -0800 | [diff] [blame] | 248 | bool found_script[2]; |
Behdad Esfahbod | 6fddf2d | 2012-11-12 17:57:24 -0800 | [diff] [blame] | 249 | unsigned int script_index[2], language_index[2]; |
| 250 | |
Behdad Esfahbod | 5ab3855 | 2012-11-12 18:27:42 -0800 | [diff] [blame] | 251 | private: |
| 252 | |
Behdad Esfahbod | b70c96d | 2011-07-07 21:07:41 -0400 | [diff] [blame] | 253 | unsigned int current_stage[2]; /* GSUB/GPOS */ |
Behdad Esfahbod | 5c3112a | 2018-05-01 19:07:04 -0400 | [diff] [blame] | 254 | hb_vector_t<feature_info_t, 32> feature_infos; |
| 255 | hb_vector_t<stage_info_t, 8> stages[2]; /* GSUB/GPOS */ |
Behdad Esfahbod | f6d7a9b | 2011-07-07 16:20:35 -0400 | [diff] [blame] | 256 | }; |
| 257 | |
| 258 | |
Behdad Esfahbod | 4924aff | 2010-10-08 19:18:16 -0400 | [diff] [blame] | 259 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 260 | #endif /* HB_OT_MAP_HH */ |