[buffer/deserialize] Accept arbitrary glyph names
Accepts escapes. Added TODO items for matching escaping in serialize().
This commit is contained in:
parent
4a4eebcf86
commit
c396e1600f
|
@ -39,8 +39,8 @@ static const unsigned char _deserialize_json_trans_keys[] = {
|
|||
9u, 125u, 9u, 125u, 108u, 108u, 34u, 34u, 9u, 58u, 9u, 57u, 9u, 125u, 9u, 125u,
|
||||
120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u,
|
||||
9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u,
|
||||
65u, 122u, 34u, 122u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, 9u, 125u,
|
||||
9u, 93u, 9u, 123u, 0u, 0u, 0
|
||||
34u, 92u, 9u, 125u, 34u, 92u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u,
|
||||
9u, 125u, 9u, 93u, 9u, 123u, 0u, 0u, 0
|
||||
};
|
||||
|
||||
static const char _deserialize_json_key_spans[] = {
|
||||
|
@ -49,8 +49,8 @@ static const char _deserialize_json_key_spans[] = {
|
|||
117, 117, 1, 1, 50, 49, 117, 117,
|
||||
2, 1, 50, 49, 10, 117, 117, 1,
|
||||
50, 49, 10, 117, 117, 1, 50, 49,
|
||||
58, 89, 117, 117, 1, 50, 49, 117,
|
||||
85, 115, 0
|
||||
59, 117, 59, 117, 117, 1, 50, 49,
|
||||
117, 85, 115, 0
|
||||
};
|
||||
|
||||
static const short _deserialize_json_index_offsets[] = {
|
||||
|
@ -59,8 +59,8 @@ static const short _deserialize_json_index_offsets[] = {
|
|||
750, 868, 986, 988, 990, 1041, 1091, 1209,
|
||||
1327, 1330, 1332, 1383, 1433, 1444, 1562, 1680,
|
||||
1682, 1733, 1783, 1794, 1912, 2030, 2032, 2083,
|
||||
2133, 2192, 2282, 2400, 2518, 2520, 2571, 2621,
|
||||
2739, 2825, 2941
|
||||
2133, 2193, 2311, 2371, 2489, 2607, 2609, 2660,
|
||||
2710, 2828, 2914, 3030
|
||||
};
|
||||
|
||||
static const char _deserialize_json_indicies[] = {
|
||||
|
@ -330,30 +330,19 @@ static const char _deserialize_json_indicies[] = {
|
|||
1, 1, 1, 66, 1, 67, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 68, 69, 69, 69, 69,
|
||||
69, 69, 69, 69, 69, 1, 70, 70,
|
||||
69, 69, 69, 69, 69, 1, 71, 70,
|
||||
70, 70, 70, 70, 70, 70, 70, 70,
|
||||
70, 70, 70, 70, 70, 70, 70, 70,
|
||||
70, 70, 70, 70, 70, 70, 70, 70,
|
||||
1, 1, 1, 1, 1, 1, 70, 70,
|
||||
70, 70, 70, 70, 70, 70, 70, 70,
|
||||
70, 70, 70, 70, 70, 70, 70, 70,
|
||||
70, 70, 70, 70, 70, 70, 70, 70,
|
||||
1, 71, 72, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 72, 72, 1, 72,
|
||||
72, 72, 72, 72, 72, 72, 72, 72,
|
||||
72, 1, 1, 1, 1, 1, 1, 1,
|
||||
72, 72, 72, 72, 72, 72, 72, 72,
|
||||
72, 72, 72, 72, 72, 72, 72, 72,
|
||||
72, 72, 72, 72, 72, 72, 72, 72,
|
||||
72, 72, 1, 1, 1, 1, 72, 1,
|
||||
72, 72, 72, 72, 72, 72, 72, 72,
|
||||
72, 72, 72, 72, 72, 72, 72, 72,
|
||||
72, 72, 72, 72, 72, 72, 72, 72,
|
||||
72, 72, 1, 73, 73, 73, 73, 73,
|
||||
70, 70, 70, 70, 70, 70, 70, 70,
|
||||
72, 70, 73, 73, 73, 73, 73, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 73, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 74, 1,
|
||||
1, 73, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 74, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
|
@ -363,64 +352,19 @@ static const char _deserialize_json_indicies[] = {
|
|||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 75,
|
||||
1, 73, 73, 73, 73, 73, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
73, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 74, 1, 1, 1,
|
||||
76, 76, 76, 76, 76, 76, 76, 76,
|
||||
76, 76, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 75, 1,
|
||||
70, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 70, 1, 76, 76, 76, 76,
|
||||
76, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 75, 1, 77,
|
||||
1, 77, 77, 77, 77, 77, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
77, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 78, 1, 78, 78, 78, 78,
|
||||
78, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 78, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 79, 80, 80, 80, 80,
|
||||
80, 80, 80, 80, 80, 1, 73, 73,
|
||||
73, 73, 73, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 73, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 74, 1, 1, 1, 81, 81, 81,
|
||||
81, 81, 81, 81, 81, 81, 81, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 75, 1, 82, 82, 82, 82,
|
||||
82, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 82, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 83,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
84, 1, 0, 0, 0, 0, 0, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 0, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 76, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 77,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
|
@ -431,21 +375,89 @@ static const char _deserialize_json_indicies[] = {
|
|||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 2, 1, 1, 0
|
||||
78, 1, 76, 76, 76, 76, 76, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 76, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 77, 1, 1,
|
||||
1, 79, 79, 79, 79, 79, 79, 79,
|
||||
79, 79, 79, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 78, 1,
|
||||
80, 1, 80, 80, 80, 80, 80, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 80, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 81, 1, 81, 81, 81,
|
||||
81, 81, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 81, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 82, 83, 83, 83,
|
||||
83, 83, 83, 83, 83, 83, 1, 76,
|
||||
76, 76, 76, 76, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 76, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 77, 1, 1, 1, 84, 84,
|
||||
84, 84, 84, 84, 84, 84, 84, 84,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 78, 1, 85, 85, 85,
|
||||
85, 85, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 85, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
86, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 87, 1, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 0, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 2, 1, 1,
|
||||
0
|
||||
};
|
||||
|
||||
static const char _deserialize_json_trans_targs[] = {
|
||||
1, 0, 2, 2, 3, 4, 18, 24,
|
||||
37, 44, 5, 12, 6, 7, 8, 9,
|
||||
11, 9, 11, 10, 2, 48, 10, 48,
|
||||
37, 45, 5, 12, 6, 7, 8, 9,
|
||||
11, 9, 11, 10, 2, 49, 10, 49,
|
||||
13, 14, 15, 16, 17, 16, 17, 10,
|
||||
2, 48, 19, 20, 21, 22, 23, 10,
|
||||
2, 48, 23, 25, 31, 26, 27, 28,
|
||||
29, 30, 29, 30, 10, 2, 48, 32,
|
||||
2, 49, 19, 20, 21, 22, 23, 10,
|
||||
2, 49, 23, 25, 31, 26, 27, 28,
|
||||
29, 30, 29, 30, 10, 2, 49, 32,
|
||||
33, 34, 35, 36, 35, 36, 10, 2,
|
||||
48, 38, 39, 40, 42, 43, 41, 10,
|
||||
41, 10, 2, 48, 43, 45, 46, 42,
|
||||
47, 47, 48, 49, 50
|
||||
49, 38, 39, 40, 43, 44, 40, 41,
|
||||
42, 10, 2, 49, 10, 2, 49, 44,
|
||||
46, 47, 43, 48, 48, 49, 50, 51
|
||||
};
|
||||
|
||||
static const char _deserialize_json_trans_actions[] = {
|
||||
|
@ -457,19 +469,19 @@ static const char _deserialize_json_trans_actions[] = {
|
|||
8, 9, 0, 0, 0, 0, 0, 2,
|
||||
2, 2, 0, 0, 10, 10, 11, 0,
|
||||
0, 2, 2, 2, 0, 0, 12, 12,
|
||||
13, 0, 0, 0, 14, 14, 2, 15,
|
||||
0, 16, 16, 17, 18, 0, 0, 19,
|
||||
19, 20, 0, 0, 0
|
||||
13, 0, 0, 2, 14, 14, 0, 15,
|
||||
0, 16, 16, 17, 18, 18, 19, 15,
|
||||
0, 0, 20, 20, 21, 0, 0, 0
|
||||
};
|
||||
|
||||
static const int deserialize_json_start = 1;
|
||||
static const int deserialize_json_first_final = 48;
|
||||
static const int deserialize_json_first_final = 49;
|
||||
static const int deserialize_json_error = 0;
|
||||
|
||||
static const int deserialize_json_en_main = 1;
|
||||
|
||||
|
||||
#line 122 "hb-buffer-deserialize-json.rl"
|
||||
#line 129 "hb-buffer-deserialize-json.rl"
|
||||
|
||||
|
||||
static hb_bool_t
|
||||
|
@ -496,12 +508,12 @@ _hb_buffer_deserialize_json (hb_buffer_t *buffer,
|
|||
hb_glyph_info_t info = {0};
|
||||
hb_glyph_position_t pos = {0};
|
||||
|
||||
#line 500 "hb-buffer-deserialize-json.hh"
|
||||
#line 512 "hb-buffer-deserialize-json.hh"
|
||||
{
|
||||
cs = deserialize_json_start;
|
||||
}
|
||||
|
||||
#line 505 "hb-buffer-deserialize-json.hh"
|
||||
#line 517 "hb-buffer-deserialize-json.hh"
|
||||
{
|
||||
int _slen;
|
||||
int _trans;
|
||||
|
@ -549,7 +561,7 @@ _resume:
|
|||
tok = p;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
case 15:
|
||||
#line 55 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_GLYPHS))
|
||||
|
@ -563,7 +575,7 @@ _resume:
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 20:
|
||||
case 21:
|
||||
#line 67 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_UNICODE))
|
||||
|
@ -578,27 +590,37 @@ _resume:
|
|||
}
|
||||
break;
|
||||
case 16:
|
||||
#line 86 "hb-buffer-deserialize-json.rl"
|
||||
#line 79 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
/* TODO Unescape \" and \\ if found. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
#line 87 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_uint (tok, p, &info.codepoint)) return false; }
|
||||
break;
|
||||
case 8:
|
||||
#line 87 "hb-buffer-deserialize-json.rl"
|
||||
#line 88 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_uint (tok, p, &info.cluster )) return false; }
|
||||
break;
|
||||
case 10:
|
||||
#line 88 "hb-buffer-deserialize-json.rl"
|
||||
#line 89 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_offset )) return false; }
|
||||
break;
|
||||
case 12:
|
||||
#line 89 "hb-buffer-deserialize-json.rl"
|
||||
#line 90 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_offset )) return false; }
|
||||
break;
|
||||
case 3:
|
||||
#line 90 "hb-buffer-deserialize-json.rl"
|
||||
#line 91 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_advance)) return false; }
|
||||
break;
|
||||
case 6:
|
||||
#line 91 "hb-buffer-deserialize-json.rl"
|
||||
#line 92 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_advance)) return false; }
|
||||
break;
|
||||
case 14:
|
||||
|
@ -619,7 +641,7 @@ _resume:
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
case 20:
|
||||
#line 51 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
tok = p;
|
||||
|
@ -637,29 +659,26 @@ _resume:
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
case 17:
|
||||
#line 79 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
/* TODO Unescape \" and \\ if found. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
#line 55 "hb-buffer-deserialize-json.rl"
|
||||
#line 43 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_GLYPHS))
|
||||
{
|
||||
if (buffer->content_type != HB_BUFFER_CONTENT_TYPE_INVALID) {
|
||||
buffer->clear();
|
||||
return false;
|
||||
}
|
||||
assert (buffer->len == 0);
|
||||
buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
|
||||
}
|
||||
buffer->add_info (info);
|
||||
if (unlikely (!buffer->successful))
|
||||
return false;
|
||||
buffer->pos[buffer->len - 1] = pos;
|
||||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
#line 86 "hb-buffer-deserialize-json.rl"
|
||||
case 19:
|
||||
#line 87 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_uint (tok, p, &info.codepoint)) return false; }
|
||||
#line 43 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
|
@ -671,7 +690,7 @@ _resume:
|
|||
}
|
||||
break;
|
||||
case 9:
|
||||
#line 87 "hb-buffer-deserialize-json.rl"
|
||||
#line 88 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_uint (tok, p, &info.cluster )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
|
@ -683,7 +702,7 @@ _resume:
|
|||
}
|
||||
break;
|
||||
case 11:
|
||||
#line 88 "hb-buffer-deserialize-json.rl"
|
||||
#line 89 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_offset )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
|
@ -695,7 +714,7 @@ _resume:
|
|||
}
|
||||
break;
|
||||
case 13:
|
||||
#line 89 "hb-buffer-deserialize-json.rl"
|
||||
#line 90 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_offset )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
|
@ -707,7 +726,7 @@ _resume:
|
|||
}
|
||||
break;
|
||||
case 4:
|
||||
#line 90 "hb-buffer-deserialize-json.rl"
|
||||
#line 91 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_advance)) return false; }
|
||||
#line 43 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
|
@ -719,7 +738,7 @@ _resume:
|
|||
}
|
||||
break;
|
||||
case 7:
|
||||
#line 91 "hb-buffer-deserialize-json.rl"
|
||||
#line 92 "hb-buffer-deserialize-json.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_advance)) return false; }
|
||||
#line 43 "hb-buffer-deserialize-json.rl"
|
||||
{
|
||||
|
@ -730,7 +749,7 @@ _resume:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
#line 734 "hb-buffer-deserialize-json.hh"
|
||||
#line 753 "hb-buffer-deserialize-json.hh"
|
||||
}
|
||||
|
||||
_again:
|
||||
|
@ -742,7 +761,7 @@ _again:
|
|||
_out: {}
|
||||
}
|
||||
|
||||
#line 150 "hb-buffer-deserialize-json.rl"
|
||||
#line 157 "hb-buffer-deserialize-json.rl"
|
||||
|
||||
|
||||
*end_ptr = p;
|
||||
|
|
|
@ -77,6 +77,7 @@ action ensure_unicode {
|
|||
}
|
||||
|
||||
action parse_glyph_name {
|
||||
/* TODO Unescape \" and \\ if found. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
|
@ -97,20 +98,26 @@ comma = space* ',' space*;
|
|||
colon = space* ':' space*;
|
||||
|
||||
codepoint = unum;
|
||||
glyph_name = alpha (alnum|'_'|'.'|'-'|'#')*;
|
||||
glyph_name = '"' ([^\\"] | '\\' [\\"])* '"';
|
||||
|
||||
parse_glyph_name = '"' (glyph_name >tok %parse_glyph_name) '"';
|
||||
parse_glyph_name = (glyph_name >tok %parse_glyph_name);
|
||||
parse_codepoint = (codepoint >tok %parse_codepoint);
|
||||
|
||||
glyph = "\"g\"" colon (parse_glyph_name | parse_codepoint) @ensure_glyphs;
|
||||
unicode = "\"u\"" colon parse_codepoint @ensure_unicode;
|
||||
glyph = "\"g\"" colon (parse_glyph_name | parse_codepoint);
|
||||
unicode = "\"u\"" colon parse_codepoint;
|
||||
cluster = "\"cl\"" colon (unum >tok %parse_cluster);
|
||||
xoffset = "\"dx\"" colon (num >tok %parse_x_offset);
|
||||
yoffset = "\"dy\"" colon (num >tok %parse_y_offset);
|
||||
xadvance= "\"ax\"" colon (num >tok %parse_x_advance);
|
||||
yadvance= "\"ay\"" colon (num >tok %parse_y_advance);
|
||||
|
||||
element = glyph | unicode | cluster | xoffset | yoffset | xadvance | yadvance;
|
||||
element = glyph @ensure_glyphs
|
||||
| unicode @ensure_unicode
|
||||
| cluster
|
||||
| xoffset
|
||||
| yoffset
|
||||
| xadvance
|
||||
| yadvance;
|
||||
item =
|
||||
( '{' space* element (comma element)* space* '}')
|
||||
>clear_item
|
||||
|
|
|
@ -34,27 +34,27 @@
|
|||
|
||||
#line 36 "hb-buffer-deserialize-text.hh"
|
||||
static const unsigned char _deserialize_text_trans_keys[] = {
|
||||
0u, 0u, 9u, 91u, 85u, 85u, 43u, 43u, 48u, 102u, 9u, 85u, 48u, 57u, 48u, 122u,
|
||||
9u, 122u, 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u, 48u, 57u,
|
||||
44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u, 9u, 124u, 9u, 124u, 0u, 0u, 9u, 85u,
|
||||
9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 122u, 9u, 124u, 9u, 124u, 9u, 124u,
|
||||
9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 0
|
||||
0u, 0u, 9u, 91u, 85u, 85u, 43u, 43u, 48u, 102u, 9u, 85u, 48u, 57u, 45u, 57u,
|
||||
48u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u,
|
||||
43u, 124u, 45u, 57u, 48u, 57u, 9u, 124u, 9u, 124u, 0u, 0u, 9u, 85u, 9u, 124u,
|
||||
9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u,
|
||||
9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 0
|
||||
};
|
||||
|
||||
static const char _deserialize_text_key_spans[] = {
|
||||
0, 83, 1, 1, 55, 77, 10, 75,
|
||||
114, 13, 10, 13, 10, 10, 13, 10,
|
||||
1, 13, 10, 14, 116, 116, 0, 77,
|
||||
116, 116, 116, 116, 114, 116, 116, 116,
|
||||
116, 116, 116, 116, 116, 116, 116
|
||||
0, 83, 1, 1, 55, 77, 10, 13,
|
||||
10, 10, 13, 10, 1, 13, 10, 14,
|
||||
82, 13, 10, 116, 116, 0, 77, 116,
|
||||
116, 116, 116, 116, 116, 116, 116, 116,
|
||||
116, 116, 116, 116, 116
|
||||
};
|
||||
|
||||
static const short _deserialize_text_index_offsets[] = {
|
||||
0, 0, 84, 86, 88, 144, 222, 233,
|
||||
309, 424, 438, 449, 463, 474, 485, 499,
|
||||
510, 512, 526, 537, 552, 669, 786, 787,
|
||||
865, 982, 1099, 1216, 1333, 1448, 1565, 1682,
|
||||
1799, 1916, 2033, 2150, 2267, 2384, 2501
|
||||
247, 258, 269, 283, 294, 296, 310, 321,
|
||||
336, 419, 433, 444, 561, 678, 679, 757,
|
||||
874, 991, 1108, 1225, 1342, 1459, 1576, 1693,
|
||||
1810, 1927, 2044, 2161, 2278
|
||||
};
|
||||
|
||||
static const char _deserialize_text_indicies[] = {
|
||||
|
@ -87,61 +87,72 @@ static const char _deserialize_text_indicies[] = {
|
|||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 4, 1, 8,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 1, 10, 11, 11, 11, 11, 11,
|
||||
11, 11, 11, 11, 1, 1, 1, 1,
|
||||
1, 1, 1, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 1, 1, 1,
|
||||
1, 1, 1, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 1, 13, 13,
|
||||
13, 13, 13, 1, 1, 1, 1, 1,
|
||||
9, 1, 10, 1, 1, 11, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 1,
|
||||
13, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 1, 15, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 1, 17, 1,
|
||||
1, 18, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 1, 20, 21, 21, 21,
|
||||
21, 21, 21, 21, 21, 21, 1, 22,
|
||||
1, 23, 1, 1, 24, 25, 25, 25,
|
||||
25, 25, 25, 25, 25, 25, 1, 26,
|
||||
27, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 1, 22, 1, 1, 1, 21, 21,
|
||||
21, 21, 21, 21, 21, 21, 21, 21,
|
||||
1, 28, 28, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 13, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 10, 11, 11,
|
||||
11, 11, 11, 11, 11, 11, 11, 1,
|
||||
1, 1, 1, 1, 1, 1, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
1, 1, 1, 1, 1, 1, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
1, 14, 1, 1, 15, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 1, 17,
|
||||
18, 18, 18, 18, 18, 18, 18, 18,
|
||||
18, 1, 19, 1, 1, 20, 21, 21,
|
||||
21, 21, 21, 21, 21, 21, 21, 1,
|
||||
22, 23, 23, 23, 23, 23, 23, 23,
|
||||
23, 23, 1, 24, 25, 25, 25, 25,
|
||||
25, 25, 25, 25, 25, 1, 26, 1,
|
||||
1, 27, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 1, 29, 30, 30, 30,
|
||||
30, 30, 30, 30, 30, 30, 1, 31,
|
||||
1, 32, 1, 1, 33, 34, 34, 34,
|
||||
34, 34, 34, 34, 34, 34, 1, 35,
|
||||
36, 36, 36, 36, 36, 36, 36, 36,
|
||||
36, 1, 31, 1, 1, 1, 30, 30,
|
||||
30, 30, 30, 30, 30, 30, 30, 30,
|
||||
1, 37, 37, 37, 37, 37, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
37, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
38, 38, 38, 38, 38, 38, 38, 38,
|
||||
38, 38, 1, 1, 1, 39, 40, 1,
|
||||
1, 38, 38, 38, 38, 38, 38, 1,
|
||||
1, 1, 1, 28, 1, 1, 28, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 38, 38, 38, 38, 38, 38, 1,
|
||||
1, 1, 28, 28, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 41, 1, 42, 42,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 28, 1, 29, 1, 1, 30,
|
||||
31, 31, 31, 31, 31, 31, 31, 31,
|
||||
31, 1, 32, 33, 33, 33, 33, 33,
|
||||
33, 33, 33, 33, 1, 34, 34, 34,
|
||||
34, 34, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 34, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 35, 35, 35, 35,
|
||||
35, 35, 35, 35, 35, 35, 1, 1,
|
||||
1, 36, 37, 1, 1, 35, 35, 35,
|
||||
35, 35, 35, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 35, 35, 35,
|
||||
35, 35, 35, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
38, 1, 39, 39, 39, 39, 39, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 39, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 40,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 41, 1, 1,
|
||||
7, 7, 7, 7, 7, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 7,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 4, 1, 42, 42,
|
||||
42, 42, 42, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 42, 1, 1,
|
||||
|
@ -156,38 +167,68 @@ static const char _deserialize_text_indicies[] = {
|
|||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 44, 1, 1, 7, 7, 7, 7,
|
||||
7, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 7, 1, 1, 1, 1,
|
||||
1, 44, 1, 42, 42, 42, 42, 42,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 42, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
4, 1, 45, 45, 45, 45, 45, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 45, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 46,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 47, 1, 45,
|
||||
1, 1, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 1, 1, 1, 1,
|
||||
43, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 45, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48,
|
||||
1, 1, 1, 1, 46, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 44, 1,
|
||||
47, 47, 47, 47, 47, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 47,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 48, 1, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 49, 46, 46, 50,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 51, 52, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 53, 46, 54, 54, 54,
|
||||
54, 54, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 54, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 55,
|
||||
1, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 56, 28, 28, 57, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
58, 59, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28,
|
||||
60, 28, 61, 61, 61, 61, 61, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 61, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 62, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 63, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 64, 1, 65,
|
||||
65, 65, 65, 65, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 65, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
|
@ -195,241 +236,172 @@ static const char _deserialize_text_indicies[] = {
|
|||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 47, 1, 49, 49, 49, 49,
|
||||
49, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 49, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 50, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
51, 1, 1, 52, 1, 1, 1, 1,
|
||||
1, 1, 1, 40, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
53, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 54,
|
||||
1, 55, 55, 55, 55, 55, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
55, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 66, 1, 67, 67, 67, 67,
|
||||
67, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 67, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 48, 1,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
49, 46, 46, 50, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 51,
|
||||
52, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 53,
|
||||
46, 68, 68, 68, 68, 68, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
68, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 69, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
70, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 43, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 56, 1, 13, 13,
|
||||
13, 13, 13, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 71, 1, 72, 72,
|
||||
72, 72, 72, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 13, 1, 1,
|
||||
1, 1, 1, 1, 1, 72, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 10, 11, 11,
|
||||
11, 11, 11, 11, 11, 11, 11, 1,
|
||||
1, 1, 1, 1, 1, 1, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
1, 1, 1, 1, 1, 1, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12,
|
||||
1, 49, 49, 49, 49, 49, 1, 1,
|
||||
73, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
49, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 50, 1, 1, 1, 1,
|
||||
57, 57, 57, 57, 57, 57, 57, 57,
|
||||
57, 57, 1, 1, 1, 51, 1, 1,
|
||||
52, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 53, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 74, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 54, 1, 58, 58,
|
||||
58, 58, 58, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 58, 1, 1,
|
||||
1, 75, 1, 72, 72, 72, 72, 72,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 59, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 72, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 73, 1, 1,
|
||||
1, 1, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 27, 27, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 74,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 60, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 75, 1,
|
||||
68, 68, 68, 68, 68, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 61, 1, 62, 62, 62, 62, 62,
|
||||
1, 1, 1, 1, 1, 1, 1, 68,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 69, 1, 1, 1, 1, 76,
|
||||
76, 76, 76, 76, 76, 76, 76, 76,
|
||||
76, 1, 1, 1, 1, 1, 1, 70,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 62, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 43, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 71, 1, 77, 77, 77,
|
||||
77, 77, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 63,
|
||||
1, 1, 1, 1, 77, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 64, 1,
|
||||
62, 62, 62, 62, 62, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 62,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 23,
|
||||
23, 23, 23, 23, 23, 23, 23, 23,
|
||||
23, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 78, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 63, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
79, 1, 77, 77, 77, 77, 77, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 64, 1, 58, 58, 58,
|
||||
58, 58, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 58, 1, 1, 1,
|
||||
1, 77, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
59, 1, 1, 1, 18, 18, 18, 18,
|
||||
18, 18, 18, 18, 18, 18, 1, 1,
|
||||
1, 33, 33, 33, 33, 33, 33, 33,
|
||||
33, 33, 33, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 78, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 60, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 79, 1, 61,
|
||||
61, 61, 61, 61, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
61, 1, 65, 65, 65, 65, 65, 1,
|
||||
1, 1, 1, 1, 1, 1, 61, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 62, 1, 1, 1, 14, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 65, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 66, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 67, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 63, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 46, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 68, 1, 69,
|
||||
69, 69, 69, 69, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 69, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 70, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 71, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 72, 1, 69, 69, 69, 69,
|
||||
69, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 69, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 70, 1,
|
||||
1, 1, 1, 36, 36, 36, 36, 36,
|
||||
36, 36, 36, 36, 36, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
71, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 72,
|
||||
1, 65, 65, 65, 65, 65, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
65, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 66, 1, 1, 1, 1,
|
||||
73, 73, 73, 73, 73, 73, 73, 73,
|
||||
73, 73, 1, 1, 1, 1, 1, 1,
|
||||
67, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 46, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 68, 1, 49, 49,
|
||||
49, 49, 49, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 49, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
50, 1, 74, 74, 1, 74, 74, 74,
|
||||
74, 74, 74, 74, 74, 74, 74, 1,
|
||||
1, 1, 51, 1, 1, 52, 74, 74,
|
||||
74, 74, 74, 74, 74, 74, 74, 74,
|
||||
74, 74, 74, 74, 74, 74, 74, 74,
|
||||
74, 74, 74, 74, 74, 74, 74, 74,
|
||||
1, 1, 53, 1, 74, 1, 74, 74,
|
||||
74, 74, 74, 74, 74, 74, 74, 74,
|
||||
74, 74, 74, 74, 74, 74, 74, 74,
|
||||
74, 74, 74, 74, 74, 74, 74, 74,
|
||||
1, 54, 1, 0
|
||||
1, 1, 64, 1, 0
|
||||
};
|
||||
|
||||
static const char _deserialize_text_trans_targs[] = {
|
||||
1, 0, 2, 7, 3, 4, 20, 5,
|
||||
24, 25, 26, 29, 38, 8, 10, 30,
|
||||
33, 30, 33, 12, 31, 32, 31, 32,
|
||||
34, 37, 15, 16, 19, 16, 19, 17,
|
||||
18, 35, 36, 35, 36, 21, 20, 6,
|
||||
22, 23, 21, 22, 23, 21, 22, 23,
|
||||
25, 27, 9, 13, 14, 22, 28, 27,
|
||||
28, 29, 27, 11, 22, 28, 27, 22,
|
||||
28, 27, 9, 14, 28, 27, 9, 22,
|
||||
28, 37, 38
|
||||
1, 0, 2, 25, 3, 4, 19, 5,
|
||||
23, 24, 8, 27, 36, 27, 36, 30,
|
||||
33, 11, 12, 15, 12, 15, 13, 14,
|
||||
31, 32, 31, 32, 26, 18, 34, 35,
|
||||
34, 35, 20, 19, 6, 21, 22, 20,
|
||||
21, 22, 20, 21, 22, 24, 26, 26,
|
||||
7, 9, 10, 16, 21, 29, 26, 7,
|
||||
9, 10, 16, 21, 29, 28, 17, 21,
|
||||
29, 28, 29, 29, 28, 7, 10, 29,
|
||||
28, 7, 21, 29, 33, 28, 21, 29
|
||||
};
|
||||
|
||||
static const char _deserialize_text_trans_actions[] = {
|
||||
0, 0, 0, 0, 1, 0, 2, 0,
|
||||
3, 3, 4, 4, 4, 0, 3, 3,
|
||||
3, 0, 0, 3, 3, 3, 0, 0,
|
||||
3, 3, 3, 3, 3, 0, 0, 5,
|
||||
3, 3, 3, 0, 0, 6, 7, 8,
|
||||
6, 6, 0, 0, 0, 9, 9, 9,
|
||||
0, 10, 11, 11, 11, 10, 10, 0,
|
||||
0, 12, 13, 14, 13, 13, 15, 15,
|
||||
15, 9, 16, 16, 9, 17, 18, 17,
|
||||
17, 0, 12
|
||||
2, 2, 3, 4, 4, 5, 5, 4,
|
||||
4, 3, 3, 3, 0, 0, 6, 3,
|
||||
4, 4, 5, 5, 5, 3, 4, 4,
|
||||
5, 5, 7, 8, 9, 7, 7, 0,
|
||||
0, 0, 10, 10, 10, 8, 12, 13,
|
||||
14, 14, 14, 15, 11, 11, 17, 18,
|
||||
18, 18, 0, 16, 16, 19, 20, 19,
|
||||
19, 0, 0, 13, 10, 21, 21, 10,
|
||||
22, 23, 22, 22, 5, 24, 24, 24
|
||||
};
|
||||
|
||||
static const char _deserialize_text_eof_actions[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0,
|
||||
9, 9, 10, 0, 0, 10, 13, 15,
|
||||
15, 13, 9, 17, 17, 9, 10
|
||||
0, 0, 0, 7, 0, 0, 0, 10,
|
||||
10, 11, 16, 19, 0, 11, 10, 22,
|
||||
22, 10, 24, 24, 19
|
||||
};
|
||||
|
||||
static const int deserialize_text_start = 1;
|
||||
static const int deserialize_text_first_final = 20;
|
||||
static const int deserialize_text_first_final = 19;
|
||||
static const int deserialize_text_error = 0;
|
||||
|
||||
static const int deserialize_text_en_main = 1;
|
||||
|
||||
|
||||
#line 132 "hb-buffer-deserialize-text.rl"
|
||||
#line 135 "hb-buffer-deserialize-text.rl"
|
||||
|
||||
|
||||
static hb_bool_t
|
||||
|
@ -452,12 +424,12 @@ _hb_buffer_deserialize_text (hb_buffer_t *buffer,
|
|||
hb_glyph_info_t info = {0};
|
||||
hb_glyph_position_t pos = {0};
|
||||
|
||||
#line 456 "hb-buffer-deserialize-text.hh"
|
||||
#line 428 "hb-buffer-deserialize-text.hh"
|
||||
{
|
||||
cs = deserialize_text_start;
|
||||
}
|
||||
|
||||
#line 461 "hb-buffer-deserialize-text.hh"
|
||||
#line 433 "hb-buffer-deserialize-text.hh"
|
||||
{
|
||||
int _slen;
|
||||
int _trans;
|
||||
|
@ -495,7 +467,7 @@ _resume:
|
|||
tok = p;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
case 5:
|
||||
#line 55 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_GLYPHS))
|
||||
|
@ -509,7 +481,7 @@ _resume:
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
#line 67 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_UNICODE))
|
||||
|
@ -523,34 +495,64 @@ _resume:
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
case 18:
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
#line 86 "hb-buffer-deserialize-text.rl"
|
||||
case 9:
|
||||
#line 87 "hb-buffer-deserialize-text.rl"
|
||||
{if (!parse_hex (tok, p, &info.codepoint )) return false; }
|
||||
break;
|
||||
case 16:
|
||||
#line 88 "hb-buffer-deserialize-text.rl"
|
||||
case 21:
|
||||
#line 89 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_uint (tok, p, &info.cluster )) return false; }
|
||||
break;
|
||||
case 5:
|
||||
#line 89 "hb-buffer-deserialize-text.rl"
|
||||
case 6:
|
||||
#line 90 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_offset )) return false; }
|
||||
break;
|
||||
case 18:
|
||||
#line 90 "hb-buffer-deserialize-text.rl"
|
||||
case 23:
|
||||
#line 91 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_offset )) return false; }
|
||||
break;
|
||||
case 14:
|
||||
#line 91 "hb-buffer-deserialize-text.rl"
|
||||
case 20:
|
||||
#line 92 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_advance)) return false; }
|
||||
break;
|
||||
case 15:
|
||||
#line 38 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
memset (&info, 0, sizeof (info));
|
||||
memset (&pos , 0, sizeof (pos ));
|
||||
}
|
||||
#line 51 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
tok = p;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
#line 51 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
tok = p;
|
||||
}
|
||||
#line 55 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_GLYPHS))
|
||||
{
|
||||
if (buffer->content_type != HB_BUFFER_CONTENT_TYPE_INVALID) {
|
||||
buffer->clear();
|
||||
return false;
|
||||
}
|
||||
assert (buffer->len == 0);
|
||||
buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
#line 51 "hb-buffer-deserialize-text.rl"
|
||||
|
@ -570,9 +572,10 @@ _resume:
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
case 16:
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
|
@ -587,8 +590,8 @@ _resume:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
#line 86 "hb-buffer-deserialize-text.rl"
|
||||
case 7:
|
||||
#line 87 "hb-buffer-deserialize-text.rl"
|
||||
{if (!parse_hex (tok, p, &info.codepoint )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -599,8 +602,8 @@ _resume:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
#line 88 "hb-buffer-deserialize-text.rl"
|
||||
case 10:
|
||||
#line 89 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_uint (tok, p, &info.cluster )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -611,8 +614,8 @@ _resume:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
#line 90 "hb-buffer-deserialize-text.rl"
|
||||
case 22:
|
||||
#line 91 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_offset )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -623,8 +626,8 @@ _resume:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
#line 91 "hb-buffer-deserialize-text.rl"
|
||||
case 19:
|
||||
#line 92 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_advance)) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -635,8 +638,8 @@ _resume:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
#line 92 "hb-buffer-deserialize-text.rl"
|
||||
case 24:
|
||||
#line 93 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_advance)) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -647,7 +650,7 @@ _resume:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 12:
|
||||
#line 38 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
memset (&info, 0, sizeof (info));
|
||||
|
@ -670,21 +673,68 @@ _resume:
|
|||
}
|
||||
}
|
||||
break;
|
||||
#line 674 "hb-buffer-deserialize-text.hh"
|
||||
}
|
||||
|
||||
_again:
|
||||
if ( cs == 0 )
|
||||
goto _out;
|
||||
if ( ++p != pe )
|
||||
goto _resume;
|
||||
_test_eof: {}
|
||||
if ( p == eof )
|
||||
case 14:
|
||||
#line 38 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
switch ( _deserialize_text_eof_actions[cs] ) {
|
||||
case 10:
|
||||
memset (&info, 0, sizeof (info));
|
||||
memset (&pos , 0, sizeof (pos ));
|
||||
}
|
||||
#line 51 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
tok = p;
|
||||
}
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
#line 55 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_GLYPHS))
|
||||
{
|
||||
if (buffer->content_type != HB_BUFFER_CONTENT_TYPE_INVALID) {
|
||||
buffer->clear();
|
||||
return false;
|
||||
}
|
||||
assert (buffer->len == 0);
|
||||
buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
|
||||
}
|
||||
}
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
buffer->add_info (info);
|
||||
if (unlikely (!buffer->successful))
|
||||
return false;
|
||||
buffer->pos[buffer->len - 1] = pos;
|
||||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
#line 38 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
memset (&info, 0, sizeof (info));
|
||||
memset (&pos , 0, sizeof (pos ));
|
||||
}
|
||||
#line 51 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
tok = p;
|
||||
}
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
|
@ -699,8 +749,77 @@ _again:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
#line 86 "hb-buffer-deserialize-text.rl"
|
||||
case 13:
|
||||
#line 38 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
memset (&info, 0, sizeof (info));
|
||||
memset (&pos , 0, sizeof (pos ));
|
||||
}
|
||||
#line 51 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
tok = p;
|
||||
}
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
#line 55 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
if (unlikely (buffer->content_type != HB_BUFFER_CONTENT_TYPE_GLYPHS))
|
||||
{
|
||||
if (buffer->content_type != HB_BUFFER_CONTENT_TYPE_INVALID) {
|
||||
buffer->clear();
|
||||
return false;
|
||||
}
|
||||
assert (buffer->len == 0);
|
||||
buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
|
||||
}
|
||||
}
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
buffer->add_info (info);
|
||||
if (unlikely (!buffer->successful))
|
||||
return false;
|
||||
buffer->pos[buffer->len - 1] = pos;
|
||||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
#line 792 "hb-buffer-deserialize-text.hh"
|
||||
}
|
||||
|
||||
_again:
|
||||
if ( cs == 0 )
|
||||
goto _out;
|
||||
if ( ++p != pe )
|
||||
goto _resume;
|
||||
_test_eof: {}
|
||||
if ( p == eof )
|
||||
{
|
||||
switch ( _deserialize_text_eof_actions[cs] ) {
|
||||
case 16:
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
buffer->add_info (info);
|
||||
if (unlikely (!buffer->successful))
|
||||
return false;
|
||||
buffer->pos[buffer->len - 1] = pos;
|
||||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
#line 87 "hb-buffer-deserialize-text.rl"
|
||||
{if (!parse_hex (tok, p, &info.codepoint )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -711,8 +830,8 @@ _again:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
#line 88 "hb-buffer-deserialize-text.rl"
|
||||
case 10:
|
||||
#line 89 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_uint (tok, p, &info.cluster )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -723,8 +842,8 @@ _again:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
#line 90 "hb-buffer-deserialize-text.rl"
|
||||
case 22:
|
||||
#line 91 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_offset )) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -735,8 +854,8 @@ _again:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
#line 91 "hb-buffer-deserialize-text.rl"
|
||||
case 19:
|
||||
#line 92 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.x_advance)) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -747,8 +866,8 @@ _again:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
#line 92 "hb-buffer-deserialize-text.rl"
|
||||
case 24:
|
||||
#line 93 "hb-buffer-deserialize-text.rl"
|
||||
{ if (!parse_int (tok, p, &pos.y_advance)) return false; }
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
|
@ -759,14 +878,41 @@ _again:
|
|||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
#line 763 "hb-buffer-deserialize-text.hh"
|
||||
case 11:
|
||||
#line 38 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
memset (&info, 0, sizeof (info));
|
||||
memset (&pos , 0, sizeof (pos ));
|
||||
}
|
||||
#line 51 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
tok = p;
|
||||
}
|
||||
#line 79 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
return false;
|
||||
}
|
||||
#line 43 "hb-buffer-deserialize-text.rl"
|
||||
{
|
||||
buffer->add_info (info);
|
||||
if (unlikely (!buffer->successful))
|
||||
return false;
|
||||
buffer->pos[buffer->len - 1] = pos;
|
||||
*end_ptr = p;
|
||||
}
|
||||
break;
|
||||
#line 909 "hb-buffer-deserialize-text.hh"
|
||||
}
|
||||
}
|
||||
|
||||
_out: {}
|
||||
}
|
||||
|
||||
#line 156 "hb-buffer-deserialize-text.rl"
|
||||
#line 159 "hb-buffer-deserialize-text.rl"
|
||||
|
||||
|
||||
*end_ptr = p;
|
||||
|
|
|
@ -77,6 +77,7 @@ action ensure_unicode {
|
|||
}
|
||||
|
||||
action parse_glyph {
|
||||
/* TODO Unescape delimeters. */
|
||||
if (!hb_font_glyph_from_string (font,
|
||||
tok, p - tok,
|
||||
&info.codepoint))
|
||||
|
@ -95,9 +96,9 @@ unum = '0' | [1-9] digit*;
|
|||
num = '-'? unum;
|
||||
|
||||
glyph_id = unum;
|
||||
glyph_name = alpha (alnum|'_'|'.'|'-')*;
|
||||
glyph_name = ([^\\\]=@+,|] | '\\' [\\\]=@+,|]) *;
|
||||
|
||||
glyph = (glyph_id | glyph_name) >tok @ensure_glyphs %parse_glyph;
|
||||
glyph = (glyph_id | glyph_name) >tok %parse_glyph;
|
||||
cluster = '=' (unum >tok %parse_cluster);
|
||||
offsets = '@' (num >tok %parse_x_offset) ',' (num >tok %parse_y_offset );
|
||||
advances= '+' (num >tok %parse_x_advance) (',' (num >tok %parse_y_advance))?;
|
||||
|
@ -110,10 +111,11 @@ glyph_item =
|
|||
advances?
|
||||
)
|
||||
>clear_item
|
||||
@ensure_glyphs
|
||||
%add_item
|
||||
;
|
||||
|
||||
unicode = 'U' '+' xdigit+ >tok @ensure_unicode %parse_hexdigits;
|
||||
unicode = 'U' '+' xdigit+ >tok %parse_hexdigits;
|
||||
|
||||
unicode_item =
|
||||
(
|
||||
|
@ -121,6 +123,7 @@ unicode_item =
|
|||
cluster?
|
||||
)
|
||||
>clear_item
|
||||
@ensure_unicode
|
||||
%add_item
|
||||
;
|
||||
|
||||
|
|
|
@ -136,10 +136,11 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
|
|||
char g[128];
|
||||
hb_font_glyph_to_string (font, info[i].codepoint, g, sizeof (g));
|
||||
*p++ = '"';
|
||||
for (char *q = g; *q; q++) {
|
||||
if (*q == '"')
|
||||
*p++ = '\\';
|
||||
*p++ = *q;
|
||||
for (char *q = g; *q; q++)
|
||||
{
|
||||
if (unlikely (*q == '"' || *q == '\\'))
|
||||
*p++ = '\\';
|
||||
*p++ = *q;
|
||||
}
|
||||
*p++ = '"';
|
||||
}
|
||||
|
@ -153,10 +154,10 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
|
|||
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS))
|
||||
{
|
||||
p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"dx\":%d,\"dy\":%d",
|
||||
x+pos[i].x_offset, y+pos[i].y_offset));
|
||||
x+pos[i].x_offset, y+pos[i].y_offset));
|
||||
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES))
|
||||
p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"ax\":%d,\"ay\":%d",
|
||||
pos[i].x_advance, pos[i].y_advance));
|
||||
pos[i].x_advance, pos[i].y_advance));
|
||||
}
|
||||
|
||||
if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS)
|
||||
|
@ -283,6 +284,7 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
|
|||
|
||||
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES))
|
||||
{
|
||||
/* TODO Escape delimiters we use. */
|
||||
hb_font_glyph_to_string (font, info[i].codepoint, p, 128);
|
||||
p += strlen (p);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue