michael@0: michael@0: #line 1 "../../src/hb-buffer-deserialize-text.rl" michael@0: /* michael@0: * Copyright © 2013 Google, Inc. michael@0: * michael@0: * This is part of HarfBuzz, a text shaping library. michael@0: * michael@0: * Permission is hereby granted, without written agreement and without michael@0: * license or royalty fees, to use, copy, modify, and distribute this michael@0: * software and its documentation for any purpose, provided that the michael@0: * above copyright notice and the following two paragraphs appear in michael@0: * all copies of this software. michael@0: * michael@0: * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR michael@0: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES michael@0: * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN michael@0: * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH michael@0: * DAMAGE. michael@0: * michael@0: * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, michael@0: * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND michael@0: * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS michael@0: * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO michael@0: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. michael@0: * michael@0: * Google Author(s): Behdad Esfahbod michael@0: */ michael@0: michael@0: #ifndef HB_BUFFER_DESERIALIZE_TEXT_HH michael@0: #define HB_BUFFER_DESERIALIZE_TEXT_HH michael@0: michael@0: #include "hb-private.hh" michael@0: michael@0: michael@0: #line 36 "hb-buffer-deserialize-text.hh.tmp" michael@0: static const unsigned char _deserialize_text_trans_keys[] = { michael@0: 0u, 0u, 9u, 122u, 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u, michael@0: 48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u, 9u, 124u, 9u, 124u, 0u, 0u, michael@0: 9u, 122u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, michael@0: 9u, 124u, 9u, 124u, 9u, 124u, 0 michael@0: }; michael@0: michael@0: static const char _deserialize_text_key_spans[] = { michael@0: 0, 114, 13, 10, 13, 10, 10, 13, michael@0: 10, 1, 13, 10, 14, 116, 116, 0, michael@0: 114, 116, 116, 116, 116, 116, 116, 116, michael@0: 116, 116, 116 michael@0: }; michael@0: michael@0: static const short _deserialize_text_index_offsets[] = { michael@0: 0, 0, 115, 129, 140, 154, 165, 176, michael@0: 190, 201, 203, 217, 228, 243, 360, 477, michael@0: 478, 593, 710, 827, 944, 1061, 1178, 1295, michael@0: 1412, 1529, 1646 michael@0: }; michael@0: michael@0: static const char _deserialize_text_indicies[] = { michael@0: 0, 0, 0, 0, 0, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 0, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 2, 3, 3, 3, 3, 3, 3, 3, michael@0: 3, 3, 1, 1, 1, 1, 1, 1, michael@0: 1, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 1, 1, 1, 1, 1, michael@0: 1, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 1, 5, 1, 1, 6, michael@0: 7, 7, 7, 7, 7, 7, 7, 7, michael@0: 7, 1, 8, 9, 9, 9, 9, 9, michael@0: 9, 9, 9, 9, 1, 10, 1, 1, michael@0: 11, 12, 12, 12, 12, 12, 12, 12, michael@0: 12, 12, 1, 13, 14, 14, 14, 14, michael@0: 14, 14, 14, 14, 14, 1, 15, 16, michael@0: 16, 16, 16, 16, 16, 16, 16, 16, michael@0: 1, 17, 1, 1, 18, 19, 19, 19, michael@0: 19, 19, 19, 19, 19, 19, 1, 20, michael@0: 21, 21, 21, 21, 21, 21, 21, 21, michael@0: 21, 1, 22, 1, 23, 1, 1, 24, michael@0: 25, 25, 25, 25, 25, 25, 25, 25, michael@0: 25, 1, 26, 27, 27, 27, 27, 27, michael@0: 27, 27, 27, 27, 1, 22, 1, 1, michael@0: 1, 21, 21, 21, 21, 21, 21, 21, michael@0: 21, 21, 21, 1, 28, 28, 28, 28, michael@0: 28, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 28, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 29, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 30, 1, 1, 31, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 32, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 33, michael@0: 1, 34, 34, 34, 34, 34, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 34, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 35, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 36, 1, 1, 0, michael@0: 0, 0, 0, 0, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 0, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 2, 3, michael@0: 3, 3, 3, 3, 3, 3, 3, 3, michael@0: 1, 1, 1, 1, 1, 1, 1, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 1, 1, 1, 1, 1, 1, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 4, 4, 4, 4, 4, 4, 4, michael@0: 4, 1, 28, 28, 28, 28, 28, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 28, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 29, 1, 1, 1, michael@0: 1, 37, 37, 37, 37, 37, 37, 37, michael@0: 37, 37, 37, 1, 1, 1, 30, 1, michael@0: 1, 31, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 32, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 33, 1, 38, michael@0: 38, 38, 38, 38, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 38, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 39, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 40, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 41, 1, 42, 42, 42, 42, michael@0: 42, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 42, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 43, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 44, michael@0: 1, 42, 42, 42, 42, 42, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 42, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 14, 14, 14, 14, 14, 14, 14, 14, michael@0: 14, 14, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 43, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 44, 1, 38, 38, michael@0: 38, 38, 38, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 38, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 39, 1, 1, 1, 9, 9, 9, michael@0: 9, 9, 9, 9, 9, 9, 9, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 40, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 41, 1, 45, 45, 45, 45, 45, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 45, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 46, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 47, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 48, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 49, 1, michael@0: 50, 50, 50, 50, 50, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 50, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 51, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 52, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 53, 1, 50, 50, 50, michael@0: 50, 50, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 50, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 51, michael@0: 1, 1, 1, 1, 27, 27, 27, 27, michael@0: 27, 27, 27, 27, 27, 27, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 52, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 53, 1, 45, 45, 45, 45, 45, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 45, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 46, 1, 1, 1, michael@0: 1, 54, 54, 54, 54, 54, 54, 54, michael@0: 54, 54, 54, 1, 1, 1, 1, 1, michael@0: 1, 47, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 48, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 49, 1, 28, michael@0: 28, 28, 28, 28, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 28, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 29, 1, 55, 55, 1, 55, 55, michael@0: 55, 55, 55, 55, 55, 55, 55, 55, michael@0: 1, 1, 1, 30, 1, 1, 31, 55, michael@0: 55, 55, 55, 55, 55, 55, 55, 55, michael@0: 55, 55, 55, 55, 55, 55, 55, 55, michael@0: 55, 55, 55, 55, 55, 55, 55, 55, michael@0: 55, 1, 1, 32, 1, 55, 1, 55, michael@0: 55, 55, 55, 55, 55, 55, 55, 55, michael@0: 55, 55, 55, 55, 55, 55, 55, 55, michael@0: 55, 55, 55, 55, 55, 55, 55, 55, michael@0: 55, 1, 33, 1, 0 michael@0: }; michael@0: michael@0: static const char _deserialize_text_trans_targs[] = { michael@0: 1, 0, 13, 17, 26, 3, 18, 21, michael@0: 18, 21, 5, 19, 20, 19, 20, 22, michael@0: 25, 8, 9, 12, 9, 12, 10, 11, michael@0: 23, 24, 23, 24, 14, 2, 6, 7, michael@0: 15, 16, 14, 15, 16, 17, 14, 4, michael@0: 15, 16, 14, 15, 16, 14, 2, 7, michael@0: 15, 16, 14, 2, 15, 16, 25, 26 michael@0: }; michael@0: michael@0: static const char _deserialize_text_trans_actions[] = { michael@0: 0, 0, 1, 1, 1, 2, 2, 2, michael@0: 0, 0, 2, 2, 2, 0, 0, 2, michael@0: 2, 2, 2, 2, 0, 0, 3, 2, michael@0: 2, 2, 0, 0, 4, 5, 5, 5, michael@0: 4, 4, 0, 0, 0, 0, 6, 7, michael@0: 6, 6, 8, 8, 8, 9, 10, 10, michael@0: 9, 9, 11, 12, 11, 11, 0, 0 michael@0: }; michael@0: michael@0: static const char _deserialize_text_eof_actions[] = { michael@0: 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 4, 0, 0, michael@0: 0, 4, 6, 8, 8, 6, 9, 11, michael@0: 11, 9, 4 michael@0: }; michael@0: michael@0: static const int deserialize_text_start = 1; michael@0: static const int deserialize_text_first_final = 13; michael@0: static const int deserialize_text_error = 0; michael@0: michael@0: static const int deserialize_text_en_main = 1; michael@0: michael@0: michael@0: #line 91 "../../src/hb-buffer-deserialize-text.rl" michael@0: michael@0: michael@0: static hb_bool_t michael@0: _hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer, michael@0: const char *buf, michael@0: unsigned int buf_len, michael@0: const char **end_ptr, michael@0: hb_font_t *font) michael@0: { michael@0: const char *p = buf, *pe = buf + buf_len; michael@0: michael@0: /* Ensure we have positions. */ michael@0: (void) hb_buffer_get_glyph_positions (buffer, NULL); michael@0: michael@0: while (p < pe && ISSPACE (*p)) michael@0: p++; michael@0: if (p < pe && *p == (buffer->len ? '|' : '[')) michael@0: { michael@0: *end_ptr = ++p; michael@0: } michael@0: michael@0: const char *eof = pe, *tok = NULL; michael@0: int cs; michael@0: hb_glyph_info_t info; michael@0: hb_glyph_position_t pos; michael@0: michael@0: #line 343 "hb-buffer-deserialize-text.hh.tmp" michael@0: { michael@0: cs = deserialize_text_start; michael@0: } michael@0: michael@0: #line 348 "hb-buffer-deserialize-text.hh.tmp" michael@0: { michael@0: int _slen; michael@0: int _trans; michael@0: const unsigned char *_keys; michael@0: const char *_inds; michael@0: if ( p == pe ) michael@0: goto _test_eof; michael@0: if ( cs == 0 ) michael@0: goto _out; michael@0: _resume: michael@0: _keys = _deserialize_text_trans_keys + (cs<<1); michael@0: _inds = _deserialize_text_indicies + _deserialize_text_index_offsets[cs]; michael@0: michael@0: _slen = _deserialize_text_key_spans[cs]; michael@0: _trans = _inds[ _slen > 0 && _keys[0] <=(*p) && michael@0: (*p) <= _keys[1] ? michael@0: (*p) - _keys[0] : _slen ]; michael@0: michael@0: cs = _deserialize_text_trans_targs[_trans]; michael@0: michael@0: if ( _deserialize_text_trans_actions[_trans] == 0 ) michael@0: goto _again; michael@0: michael@0: switch ( _deserialize_text_trans_actions[_trans] ) { michael@0: case 2: michael@0: #line 51 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: tok = p; michael@0: } michael@0: break; michael@0: case 5: michael@0: #line 55 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: if (!hb_font_glyph_from_string (font, michael@0: tok, p - tok, michael@0: &info.codepoint)) michael@0: return false; michael@0: } michael@0: break; michael@0: case 10: michael@0: #line 62 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_uint (tok, p, &info.cluster )) return false; } michael@0: break; michael@0: case 3: michael@0: #line 63 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.x_offset )) return false; } michael@0: break; michael@0: case 12: michael@0: #line 64 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.y_offset )) return false; } michael@0: break; michael@0: case 7: michael@0: #line 65 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.x_advance)) return false; } michael@0: break; michael@0: case 1: michael@0: #line 38 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: memset (&info, 0, sizeof (info)); michael@0: memset (&pos , 0, sizeof (pos )); michael@0: } michael@0: #line 51 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: tok = p; michael@0: } michael@0: break; michael@0: case 4: michael@0: #line 55 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: if (!hb_font_glyph_from_string (font, michael@0: tok, p - tok, michael@0: &info.codepoint)) michael@0: return false; michael@0: } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 9: michael@0: #line 62 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_uint (tok, p, &info.cluster )) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 11: michael@0: #line 64 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.y_offset )) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 6: michael@0: #line 65 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.x_advance)) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 8: michael@0: #line 66 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.y_advance)) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: #line 480 "hb-buffer-deserialize-text.hh.tmp" michael@0: } michael@0: michael@0: _again: michael@0: if ( cs == 0 ) michael@0: goto _out; michael@0: if ( ++p != pe ) michael@0: goto _resume; michael@0: _test_eof: {} michael@0: if ( p == eof ) michael@0: { michael@0: switch ( _deserialize_text_eof_actions[cs] ) { michael@0: case 4: michael@0: #line 55 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: if (!hb_font_glyph_from_string (font, michael@0: tok, p - tok, michael@0: &info.codepoint)) michael@0: return false; michael@0: } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 9: michael@0: #line 62 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_uint (tok, p, &info.cluster )) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 11: michael@0: #line 64 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.y_offset )) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 6: michael@0: #line 65 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.x_advance)) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: case 8: michael@0: #line 66 "../../src/hb-buffer-deserialize-text.rl" michael@0: { if (!parse_int (tok, p, &pos.y_advance)) return false; } michael@0: #line 43 "../../src/hb-buffer-deserialize-text.rl" michael@0: { michael@0: buffer->add_info (info); michael@0: if (buffer->in_error) michael@0: return false; michael@0: buffer->pos[buffer->len - 1] = pos; michael@0: *end_ptr = p; michael@0: } michael@0: break; michael@0: #line 557 "hb-buffer-deserialize-text.hh.tmp" michael@0: } michael@0: } michael@0: michael@0: _out: {} michael@0: } michael@0: michael@0: #line 119 "../../src/hb-buffer-deserialize-text.rl" michael@0: michael@0: michael@0: *end_ptr = p; michael@0: michael@0: return p == pe && *(p-1) != ']'; michael@0: } michael@0: michael@0: #endif /* HB_BUFFER_DESERIALIZE_TEXT_HH */