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