gfx/harfbuzz/src/hb-buffer-deserialize-text.hh

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1
michael@0 2 #line 1 "../../src/hb-buffer-deserialize-text.rl"
michael@0 3 /*
michael@0 4 * Copyright © 2013 Google, Inc.
michael@0 5 *
michael@0 6 * This is part of HarfBuzz, a text shaping library.
michael@0 7 *
michael@0 8 * Permission is hereby granted, without written agreement and without
michael@0 9 * license or royalty fees, to use, copy, modify, and distribute this
michael@0 10 * software and its documentation for any purpose, provided that the
michael@0 11 * above copyright notice and the following two paragraphs appear in
michael@0 12 * all copies of this software.
michael@0 13 *
michael@0 14 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
michael@0 15 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
michael@0 16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
michael@0 17 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
michael@0 18 * DAMAGE.
michael@0 19 *
michael@0 20 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
michael@0 21 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
michael@0 22 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
michael@0 23 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
michael@0 24 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
michael@0 25 *
michael@0 26 * Google Author(s): Behdad Esfahbod
michael@0 27 */
michael@0 28
michael@0 29 #ifndef HB_BUFFER_DESERIALIZE_TEXT_HH
michael@0 30 #define HB_BUFFER_DESERIALIZE_TEXT_HH
michael@0 31
michael@0 32 #include "hb-private.hh"
michael@0 33
michael@0 34
michael@0 35 #line 36 "hb-buffer-deserialize-text.hh.tmp"
michael@0 36 static const unsigned char _deserialize_text_trans_keys[] = {
michael@0 37 0u, 0u, 9u, 122u, 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u,
michael@0 38 48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u, 9u, 124u, 9u, 124u, 0u, 0u,
michael@0 39 9u, 122u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u,
michael@0 40 9u, 124u, 9u, 124u, 9u, 124u, 0
michael@0 41 };
michael@0 42
michael@0 43 static const char _deserialize_text_key_spans[] = {
michael@0 44 0, 114, 13, 10, 13, 10, 10, 13,
michael@0 45 10, 1, 13, 10, 14, 116, 116, 0,
michael@0 46 114, 116, 116, 116, 116, 116, 116, 116,
michael@0 47 116, 116, 116
michael@0 48 };
michael@0 49
michael@0 50 static const short _deserialize_text_index_offsets[] = {
michael@0 51 0, 0, 115, 129, 140, 154, 165, 176,
michael@0 52 190, 201, 203, 217, 228, 243, 360, 477,
michael@0 53 478, 593, 710, 827, 944, 1061, 1178, 1295,
michael@0 54 1412, 1529, 1646
michael@0 55 };
michael@0 56
michael@0 57 static const char _deserialize_text_indicies[] = {
michael@0 58 0, 0, 0, 0, 0, 1, 1,
michael@0 59 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 60 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 61 0, 1, 1, 1, 1, 1, 1, 1,
michael@0 62 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 63 2, 3, 3, 3, 3, 3, 3, 3,
michael@0 64 3, 3, 1, 1, 1, 1, 1, 1,
michael@0 65 1, 4, 4, 4, 4, 4, 4, 4,
michael@0 66 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 67 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 68 4, 4, 4, 1, 1, 1, 1, 1,
michael@0 69 1, 4, 4, 4, 4, 4, 4, 4,
michael@0 70 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 71 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 72 4, 4, 4, 1, 5, 1, 1, 6,
michael@0 73 7, 7, 7, 7, 7, 7, 7, 7,
michael@0 74 7, 1, 8, 9, 9, 9, 9, 9,
michael@0 75 9, 9, 9, 9, 1, 10, 1, 1,
michael@0 76 11, 12, 12, 12, 12, 12, 12, 12,
michael@0 77 12, 12, 1, 13, 14, 14, 14, 14,
michael@0 78 14, 14, 14, 14, 14, 1, 15, 16,
michael@0 79 16, 16, 16, 16, 16, 16, 16, 16,
michael@0 80 1, 17, 1, 1, 18, 19, 19, 19,
michael@0 81 19, 19, 19, 19, 19, 19, 1, 20,
michael@0 82 21, 21, 21, 21, 21, 21, 21, 21,
michael@0 83 21, 1, 22, 1, 23, 1, 1, 24,
michael@0 84 25, 25, 25, 25, 25, 25, 25, 25,
michael@0 85 25, 1, 26, 27, 27, 27, 27, 27,
michael@0 86 27, 27, 27, 27, 1, 22, 1, 1,
michael@0 87 1, 21, 21, 21, 21, 21, 21, 21,
michael@0 88 21, 21, 21, 1, 28, 28, 28, 28,
michael@0 89 28, 1, 1, 1, 1, 1, 1, 1,
michael@0 90 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 91 1, 1, 1, 28, 1, 1, 1, 1,
michael@0 92 1, 1, 1, 1, 1, 1, 29, 1,
michael@0 93 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 94 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 95 30, 1, 1, 31, 1, 1, 1, 1,
michael@0 96 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 97 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 98 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 99 32, 1, 1, 1, 1, 1, 1, 1,
michael@0 100 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 101 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 102 1, 1, 1, 1, 1, 1, 1, 33,
michael@0 103 1, 34, 34, 34, 34, 34, 1, 1,
michael@0 104 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 105 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 106 34, 1, 1, 1, 1, 1, 1, 1,
michael@0 107 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 108 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 109 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 110 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 111 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 112 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 113 1, 1, 1, 1, 1, 35, 1, 1,
michael@0 114 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 115 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 116 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 117 1, 1, 1, 1, 36, 1, 1, 0,
michael@0 118 0, 0, 0, 0, 1, 1, 1, 1,
michael@0 119 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 120 1, 1, 1, 1, 1, 1, 0, 1,
michael@0 121 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 122 1, 1, 1, 1, 1, 1, 2, 3,
michael@0 123 3, 3, 3, 3, 3, 3, 3, 3,
michael@0 124 1, 1, 1, 1, 1, 1, 1, 4,
michael@0 125 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 126 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 127 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 128 4, 1, 1, 1, 1, 1, 1, 4,
michael@0 129 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 130 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 131 4, 4, 4, 4, 4, 4, 4, 4,
michael@0 132 4, 1, 28, 28, 28, 28, 28, 1,
michael@0 133 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 134 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 135 1, 28, 1, 1, 1, 1, 1, 1,
michael@0 136 1, 1, 1, 1, 29, 1, 1, 1,
michael@0 137 1, 37, 37, 37, 37, 37, 37, 37,
michael@0 138 37, 37, 37, 1, 1, 1, 30, 1,
michael@0 139 1, 31, 1, 1, 1, 1, 1, 1,
michael@0 140 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 141 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 142 1, 1, 1, 1, 1, 1, 32, 1,
michael@0 143 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 144 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 145 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 146 1, 1, 1, 1, 1, 33, 1, 38,
michael@0 147 38, 38, 38, 38, 1, 1, 1, 1,
michael@0 148 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 149 1, 1, 1, 1, 1, 1, 38, 1,
michael@0 150 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 151 1, 1, 39, 1, 1, 1, 1, 1,
michael@0 152 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 153 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 154 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 155 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 156 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 157 1, 1, 1, 40, 1, 1, 1, 1,
michael@0 158 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 159 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 160 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 161 1, 1, 41, 1, 42, 42, 42, 42,
michael@0 162 42, 1, 1, 1, 1, 1, 1, 1,
michael@0 163 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 164 1, 1, 1, 42, 1, 1, 1, 1,
michael@0 165 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 166 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 167 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 168 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 169 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 170 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 171 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 172 43, 1, 1, 1, 1, 1, 1, 1,
michael@0 173 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 174 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 175 1, 1, 1, 1, 1, 1, 1, 44,
michael@0 176 1, 42, 42, 42, 42, 42, 1, 1,
michael@0 177 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 178 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 179 42, 1, 1, 1, 1, 1, 1, 1,
michael@0 180 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 181 14, 14, 14, 14, 14, 14, 14, 14,
michael@0 182 14, 14, 1, 1, 1, 1, 1, 1,
michael@0 183 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 184 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 185 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 186 1, 1, 1, 1, 1, 43, 1, 1,
michael@0 187 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 188 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 189 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 190 1, 1, 1, 1, 44, 1, 38, 38,
michael@0 191 38, 38, 38, 1, 1, 1, 1, 1,
michael@0 192 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 193 1, 1, 1, 1, 1, 38, 1, 1,
michael@0 194 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 195 1, 39, 1, 1, 1, 9, 9, 9,
michael@0 196 9, 9, 9, 9, 9, 9, 9, 1,
michael@0 197 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 198 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 199 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 200 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 201 1, 1, 40, 1, 1, 1, 1, 1,
michael@0 202 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 203 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 204 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 205 1, 41, 1, 45, 45, 45, 45, 45,
michael@0 206 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 207 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 208 1, 1, 45, 1, 1, 1, 1, 1,
michael@0 209 1, 1, 1, 1, 1, 46, 1, 1,
michael@0 210 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 211 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 212 1, 1, 47, 1, 1, 1, 1, 1,
michael@0 213 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 214 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 215 1, 1, 1, 1, 1, 1, 1, 48,
michael@0 216 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 217 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 218 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 219 1, 1, 1, 1, 1, 1, 49, 1,
michael@0 220 50, 50, 50, 50, 50, 1, 1, 1,
michael@0 221 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 222 1, 1, 1, 1, 1, 1, 1, 50,
michael@0 223 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 224 1, 1, 51, 1, 1, 1, 1, 1,
michael@0 225 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 226 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 227 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 228 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 229 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 230 1, 1, 1, 1, 52, 1, 1, 1,
michael@0 231 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 232 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 233 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 234 1, 1, 1, 53, 1, 50, 50, 50,
michael@0 235 50, 50, 1, 1, 1, 1, 1, 1,
michael@0 236 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 237 1, 1, 1, 1, 50, 1, 1, 1,
michael@0 238 1, 1, 1, 1, 1, 1, 1, 51,
michael@0 239 1, 1, 1, 1, 27, 27, 27, 27,
michael@0 240 27, 27, 27, 27, 27, 27, 1, 1,
michael@0 241 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 242 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 243 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 244 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 245 1, 52, 1, 1, 1, 1, 1, 1,
michael@0 246 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 247 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 248 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 249 53, 1, 45, 45, 45, 45, 45, 1,
michael@0 250 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 251 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 252 1, 45, 1, 1, 1, 1, 1, 1,
michael@0 253 1, 1, 1, 1, 46, 1, 1, 1,
michael@0 254 1, 54, 54, 54, 54, 54, 54, 54,
michael@0 255 54, 54, 54, 1, 1, 1, 1, 1,
michael@0 256 1, 47, 1, 1, 1, 1, 1, 1,
michael@0 257 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 258 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 259 1, 1, 1, 1, 1, 1, 48, 1,
michael@0 260 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 261 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 262 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 263 1, 1, 1, 1, 1, 49, 1, 28,
michael@0 264 28, 28, 28, 28, 1, 1, 1, 1,
michael@0 265 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 266 1, 1, 1, 1, 1, 1, 28, 1,
michael@0 267 1, 1, 1, 1, 1, 1, 1, 1,
michael@0 268 1, 29, 1, 55, 55, 1, 55, 55,
michael@0 269 55, 55, 55, 55, 55, 55, 55, 55,
michael@0 270 1, 1, 1, 30, 1, 1, 31, 55,
michael@0 271 55, 55, 55, 55, 55, 55, 55, 55,
michael@0 272 55, 55, 55, 55, 55, 55, 55, 55,
michael@0 273 55, 55, 55, 55, 55, 55, 55, 55,
michael@0 274 55, 1, 1, 32, 1, 55, 1, 55,
michael@0 275 55, 55, 55, 55, 55, 55, 55, 55,
michael@0 276 55, 55, 55, 55, 55, 55, 55, 55,
michael@0 277 55, 55, 55, 55, 55, 55, 55, 55,
michael@0 278 55, 1, 33, 1, 0
michael@0 279 };
michael@0 280
michael@0 281 static const char _deserialize_text_trans_targs[] = {
michael@0 282 1, 0, 13, 17, 26, 3, 18, 21,
michael@0 283 18, 21, 5, 19, 20, 19, 20, 22,
michael@0 284 25, 8, 9, 12, 9, 12, 10, 11,
michael@0 285 23, 24, 23, 24, 14, 2, 6, 7,
michael@0 286 15, 16, 14, 15, 16, 17, 14, 4,
michael@0 287 15, 16, 14, 15, 16, 14, 2, 7,
michael@0 288 15, 16, 14, 2, 15, 16, 25, 26
michael@0 289 };
michael@0 290
michael@0 291 static const char _deserialize_text_trans_actions[] = {
michael@0 292 0, 0, 1, 1, 1, 2, 2, 2,
michael@0 293 0, 0, 2, 2, 2, 0, 0, 2,
michael@0 294 2, 2, 2, 2, 0, 0, 3, 2,
michael@0 295 2, 2, 0, 0, 4, 5, 5, 5,
michael@0 296 4, 4, 0, 0, 0, 0, 6, 7,
michael@0 297 6, 6, 8, 8, 8, 9, 10, 10,
michael@0 298 9, 9, 11, 12, 11, 11, 0, 0
michael@0 299 };
michael@0 300
michael@0 301 static const char _deserialize_text_eof_actions[] = {
michael@0 302 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 303 0, 0, 0, 0, 0, 4, 0, 0,
michael@0 304 0, 4, 6, 8, 8, 6, 9, 11,
michael@0 305 11, 9, 4
michael@0 306 };
michael@0 307
michael@0 308 static const int deserialize_text_start = 1;
michael@0 309 static const int deserialize_text_first_final = 13;
michael@0 310 static const int deserialize_text_error = 0;
michael@0 311
michael@0 312 static const int deserialize_text_en_main = 1;
michael@0 313
michael@0 314
michael@0 315 #line 91 "../../src/hb-buffer-deserialize-text.rl"
michael@0 316
michael@0 317
michael@0 318 static hb_bool_t
michael@0 319 _hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer,
michael@0 320 const char *buf,
michael@0 321 unsigned int buf_len,
michael@0 322 const char **end_ptr,
michael@0 323 hb_font_t *font)
michael@0 324 {
michael@0 325 const char *p = buf, *pe = buf + buf_len;
michael@0 326
michael@0 327 /* Ensure we have positions. */
michael@0 328 (void) hb_buffer_get_glyph_positions (buffer, NULL);
michael@0 329
michael@0 330 while (p < pe && ISSPACE (*p))
michael@0 331 p++;
michael@0 332 if (p < pe && *p == (buffer->len ? '|' : '['))
michael@0 333 {
michael@0 334 *end_ptr = ++p;
michael@0 335 }
michael@0 336
michael@0 337 const char *eof = pe, *tok = NULL;
michael@0 338 int cs;
michael@0 339 hb_glyph_info_t info;
michael@0 340 hb_glyph_position_t pos;
michael@0 341
michael@0 342 #line 343 "hb-buffer-deserialize-text.hh.tmp"
michael@0 343 {
michael@0 344 cs = deserialize_text_start;
michael@0 345 }
michael@0 346
michael@0 347 #line 348 "hb-buffer-deserialize-text.hh.tmp"
michael@0 348 {
michael@0 349 int _slen;
michael@0 350 int _trans;
michael@0 351 const unsigned char *_keys;
michael@0 352 const char *_inds;
michael@0 353 if ( p == pe )
michael@0 354 goto _test_eof;
michael@0 355 if ( cs == 0 )
michael@0 356 goto _out;
michael@0 357 _resume:
michael@0 358 _keys = _deserialize_text_trans_keys + (cs<<1);
michael@0 359 _inds = _deserialize_text_indicies + _deserialize_text_index_offsets[cs];
michael@0 360
michael@0 361 _slen = _deserialize_text_key_spans[cs];
michael@0 362 _trans = _inds[ _slen > 0 && _keys[0] <=(*p) &&
michael@0 363 (*p) <= _keys[1] ?
michael@0 364 (*p) - _keys[0] : _slen ];
michael@0 365
michael@0 366 cs = _deserialize_text_trans_targs[_trans];
michael@0 367
michael@0 368 if ( _deserialize_text_trans_actions[_trans] == 0 )
michael@0 369 goto _again;
michael@0 370
michael@0 371 switch ( _deserialize_text_trans_actions[_trans] ) {
michael@0 372 case 2:
michael@0 373 #line 51 "../../src/hb-buffer-deserialize-text.rl"
michael@0 374 {
michael@0 375 tok = p;
michael@0 376 }
michael@0 377 break;
michael@0 378 case 5:
michael@0 379 #line 55 "../../src/hb-buffer-deserialize-text.rl"
michael@0 380 {
michael@0 381 if (!hb_font_glyph_from_string (font,
michael@0 382 tok, p - tok,
michael@0 383 &info.codepoint))
michael@0 384 return false;
michael@0 385 }
michael@0 386 break;
michael@0 387 case 10:
michael@0 388 #line 62 "../../src/hb-buffer-deserialize-text.rl"
michael@0 389 { if (!parse_uint (tok, p, &info.cluster )) return false; }
michael@0 390 break;
michael@0 391 case 3:
michael@0 392 #line 63 "../../src/hb-buffer-deserialize-text.rl"
michael@0 393 { if (!parse_int (tok, p, &pos.x_offset )) return false; }
michael@0 394 break;
michael@0 395 case 12:
michael@0 396 #line 64 "../../src/hb-buffer-deserialize-text.rl"
michael@0 397 { if (!parse_int (tok, p, &pos.y_offset )) return false; }
michael@0 398 break;
michael@0 399 case 7:
michael@0 400 #line 65 "../../src/hb-buffer-deserialize-text.rl"
michael@0 401 { if (!parse_int (tok, p, &pos.x_advance)) return false; }
michael@0 402 break;
michael@0 403 case 1:
michael@0 404 #line 38 "../../src/hb-buffer-deserialize-text.rl"
michael@0 405 {
michael@0 406 memset (&info, 0, sizeof (info));
michael@0 407 memset (&pos , 0, sizeof (pos ));
michael@0 408 }
michael@0 409 #line 51 "../../src/hb-buffer-deserialize-text.rl"
michael@0 410 {
michael@0 411 tok = p;
michael@0 412 }
michael@0 413 break;
michael@0 414 case 4:
michael@0 415 #line 55 "../../src/hb-buffer-deserialize-text.rl"
michael@0 416 {
michael@0 417 if (!hb_font_glyph_from_string (font,
michael@0 418 tok, p - tok,
michael@0 419 &info.codepoint))
michael@0 420 return false;
michael@0 421 }
michael@0 422 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 423 {
michael@0 424 buffer->add_info (info);
michael@0 425 if (buffer->in_error)
michael@0 426 return false;
michael@0 427 buffer->pos[buffer->len - 1] = pos;
michael@0 428 *end_ptr = p;
michael@0 429 }
michael@0 430 break;
michael@0 431 case 9:
michael@0 432 #line 62 "../../src/hb-buffer-deserialize-text.rl"
michael@0 433 { if (!parse_uint (tok, p, &info.cluster )) return false; }
michael@0 434 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 435 {
michael@0 436 buffer->add_info (info);
michael@0 437 if (buffer->in_error)
michael@0 438 return false;
michael@0 439 buffer->pos[buffer->len - 1] = pos;
michael@0 440 *end_ptr = p;
michael@0 441 }
michael@0 442 break;
michael@0 443 case 11:
michael@0 444 #line 64 "../../src/hb-buffer-deserialize-text.rl"
michael@0 445 { if (!parse_int (tok, p, &pos.y_offset )) return false; }
michael@0 446 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 447 {
michael@0 448 buffer->add_info (info);
michael@0 449 if (buffer->in_error)
michael@0 450 return false;
michael@0 451 buffer->pos[buffer->len - 1] = pos;
michael@0 452 *end_ptr = p;
michael@0 453 }
michael@0 454 break;
michael@0 455 case 6:
michael@0 456 #line 65 "../../src/hb-buffer-deserialize-text.rl"
michael@0 457 { if (!parse_int (tok, p, &pos.x_advance)) return false; }
michael@0 458 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 459 {
michael@0 460 buffer->add_info (info);
michael@0 461 if (buffer->in_error)
michael@0 462 return false;
michael@0 463 buffer->pos[buffer->len - 1] = pos;
michael@0 464 *end_ptr = p;
michael@0 465 }
michael@0 466 break;
michael@0 467 case 8:
michael@0 468 #line 66 "../../src/hb-buffer-deserialize-text.rl"
michael@0 469 { if (!parse_int (tok, p, &pos.y_advance)) return false; }
michael@0 470 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 471 {
michael@0 472 buffer->add_info (info);
michael@0 473 if (buffer->in_error)
michael@0 474 return false;
michael@0 475 buffer->pos[buffer->len - 1] = pos;
michael@0 476 *end_ptr = p;
michael@0 477 }
michael@0 478 break;
michael@0 479 #line 480 "hb-buffer-deserialize-text.hh.tmp"
michael@0 480 }
michael@0 481
michael@0 482 _again:
michael@0 483 if ( cs == 0 )
michael@0 484 goto _out;
michael@0 485 if ( ++p != pe )
michael@0 486 goto _resume;
michael@0 487 _test_eof: {}
michael@0 488 if ( p == eof )
michael@0 489 {
michael@0 490 switch ( _deserialize_text_eof_actions[cs] ) {
michael@0 491 case 4:
michael@0 492 #line 55 "../../src/hb-buffer-deserialize-text.rl"
michael@0 493 {
michael@0 494 if (!hb_font_glyph_from_string (font,
michael@0 495 tok, p - tok,
michael@0 496 &info.codepoint))
michael@0 497 return false;
michael@0 498 }
michael@0 499 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 500 {
michael@0 501 buffer->add_info (info);
michael@0 502 if (buffer->in_error)
michael@0 503 return false;
michael@0 504 buffer->pos[buffer->len - 1] = pos;
michael@0 505 *end_ptr = p;
michael@0 506 }
michael@0 507 break;
michael@0 508 case 9:
michael@0 509 #line 62 "../../src/hb-buffer-deserialize-text.rl"
michael@0 510 { if (!parse_uint (tok, p, &info.cluster )) return false; }
michael@0 511 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 512 {
michael@0 513 buffer->add_info (info);
michael@0 514 if (buffer->in_error)
michael@0 515 return false;
michael@0 516 buffer->pos[buffer->len - 1] = pos;
michael@0 517 *end_ptr = p;
michael@0 518 }
michael@0 519 break;
michael@0 520 case 11:
michael@0 521 #line 64 "../../src/hb-buffer-deserialize-text.rl"
michael@0 522 { if (!parse_int (tok, p, &pos.y_offset )) return false; }
michael@0 523 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 524 {
michael@0 525 buffer->add_info (info);
michael@0 526 if (buffer->in_error)
michael@0 527 return false;
michael@0 528 buffer->pos[buffer->len - 1] = pos;
michael@0 529 *end_ptr = p;
michael@0 530 }
michael@0 531 break;
michael@0 532 case 6:
michael@0 533 #line 65 "../../src/hb-buffer-deserialize-text.rl"
michael@0 534 { if (!parse_int (tok, p, &pos.x_advance)) return false; }
michael@0 535 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 536 {
michael@0 537 buffer->add_info (info);
michael@0 538 if (buffer->in_error)
michael@0 539 return false;
michael@0 540 buffer->pos[buffer->len - 1] = pos;
michael@0 541 *end_ptr = p;
michael@0 542 }
michael@0 543 break;
michael@0 544 case 8:
michael@0 545 #line 66 "../../src/hb-buffer-deserialize-text.rl"
michael@0 546 { if (!parse_int (tok, p, &pos.y_advance)) return false; }
michael@0 547 #line 43 "../../src/hb-buffer-deserialize-text.rl"
michael@0 548 {
michael@0 549 buffer->add_info (info);
michael@0 550 if (buffer->in_error)
michael@0 551 return false;
michael@0 552 buffer->pos[buffer->len - 1] = pos;
michael@0 553 *end_ptr = p;
michael@0 554 }
michael@0 555 break;
michael@0 556 #line 557 "hb-buffer-deserialize-text.hh.tmp"
michael@0 557 }
michael@0 558 }
michael@0 559
michael@0 560 _out: {}
michael@0 561 }
michael@0 562
michael@0 563 #line 119 "../../src/hb-buffer-deserialize-text.rl"
michael@0 564
michael@0 565
michael@0 566 *end_ptr = p;
michael@0 567
michael@0 568 return p == pe && *(p-1) != ']';
michael@0 569 }
michael@0 570
michael@0 571 #endif /* HB_BUFFER_DESERIALIZE_TEXT_HH */

mercurial