author | prr |
Thu, 07 Dec 2017 11:55:06 -0800 | |
changeset 48274 | 51772bf1fb0c |
parent 47216 | 71c04702a3d5 |
child 50352 | 25db2c8f3cf8 |
permissions | -rw-r--r-- |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
1 |
/* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
2 |
* Copyright © 1998-2004 David Turner and Werner Lemberg |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
3 |
* Copyright © 2004,2007,2009 Red Hat, Inc. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
4 |
* Copyright © 2011,2012 Google, Inc. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
5 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
6 |
* This is part of HarfBuzz, a text shaping library. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
7 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
8 |
* Permission is hereby granted, without written agreement and without |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
9 |
* license or royalty fees, to use, copy, modify, and distribute this |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
10 |
* software and its documentation for any purpose, provided that the |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
11 |
* above copyright notice and the following two paragraphs appear in |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
12 |
* all copies of this software. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
13 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
14 |
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
15 |
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
16 |
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
17 |
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
18 |
* DAMAGE. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
19 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
20 |
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
21 |
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
22 |
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
23 |
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
24 |
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
25 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
26 |
* Red Hat Author(s): Owen Taylor, Behdad Esfahbod |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
27 |
* Google Author(s): Behdad Esfahbod |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
28 |
*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
29 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
30 |
#ifndef HB_H_IN |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
31 |
#error "Include <hb.h> instead." |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
32 |
#endif |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
33 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
34 |
#ifndef HB_BUFFER_H |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
35 |
#define HB_BUFFER_H |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
36 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
37 |
#include "hb-common.h" |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
38 |
#include "hb-unicode.h" |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
39 |
#include "hb-font.h" |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
40 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
41 |
HB_BEGIN_DECLS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
42 |
|
40435 | 43 |
/** |
44 |
* hb_glyph_info_t: |
|
45 |
* @codepoint: either a Unicode code point (before shaping) or a glyph index |
|
46 |
* (after shaping). |
|
47 |
* @mask: |
|
48 |
* @cluster: the index of the character in the original text that corresponds |
|
49 |
* to this #hb_glyph_info_t, or whatever the client passes to |
|
50 |
* hb_buffer_add(). More than one #hb_glyph_info_t can have the same |
|
51 |
* @cluster value, if they resulted from the same character (e.g. one |
|
52 |
* to many glyph substitution), and when more than one character gets |
|
53 |
* merged in the same glyph (e.g. many to one glyph substitution) the |
|
54 |
* #hb_glyph_info_t will have the smallest cluster value of them. |
|
55 |
* By default some characters are merged into the same cluster |
|
56 |
* (e.g. combining marks have the same cluster as their bases) |
|
57 |
* even if they are separate glyphs, hb_buffer_set_cluster_level() |
|
58 |
* allow selecting more fine-grained cluster handling. |
|
59 |
* |
|
60 |
* The #hb_glyph_info_t is the structure that holds information about the |
|
61 |
* glyphs and their relation to input text. |
|
62 |
* |
|
63 |
*/ |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
64 |
typedef struct hb_glyph_info_t { |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
65 |
hb_codepoint_t codepoint; |
48274 | 66 |
hb_mask_t mask; /* Holds hb_glyph_flags_t after hb_shape(), plus other things. */ |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
67 |
uint32_t cluster; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
68 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
69 |
/*< private >*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
70 |
hb_var_int_t var1; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
71 |
hb_var_int_t var2; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
72 |
} hb_glyph_info_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
73 |
|
48274 | 74 |
typedef enum { /*< flags >*/ |
75 |
HB_GLYPH_FLAG_UNSAFE_TO_BREAK = 0x00000001, |
|
76 |
||
77 |
HB_GLYPH_FLAG_DEFINED = 0x00000001 /* OR of all defined flags */ |
|
78 |
} hb_glyph_flags_t; |
|
79 |
||
80 |
HB_EXTERN hb_glyph_flags_t |
|
81 |
hb_glyph_info_get_glyph_flags (const hb_glyph_info_t *info); |
|
82 |
||
83 |
#define hb_glyph_info_get_glyph_flags(info) \ |
|
84 |
((hb_glyph_flags_t) ((unsigned int) (info)->mask & HB_GLYPH_FLAG_DEFINED)) |
|
85 |
||
86 |
||
40435 | 87 |
/** |
88 |
* hb_glyph_position_t: |
|
89 |
* @x_advance: how much the line advances after drawing this glyph when setting |
|
90 |
* text in horizontal direction. |
|
91 |
* @y_advance: how much the line advances after drawing this glyph when setting |
|
92 |
* text in vertical direction. |
|
93 |
* @x_offset: how much the glyph moves on the X-axis before drawing it, this |
|
94 |
* should not affect how much the line advances. |
|
95 |
* @y_offset: how much the glyph moves on the Y-axis before drawing it, this |
|
96 |
* should not affect how much the line advances. |
|
97 |
* |
|
98 |
* The #hb_glyph_position_t is the structure that holds the positions of the |
|
99 |
* glyph in both horizontal and vertical directions. All positions in |
|
100 |
* #hb_glyph_position_t are relative to the current point. |
|
101 |
* |
|
102 |
*/ |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
103 |
typedef struct hb_glyph_position_t { |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
104 |
hb_position_t x_advance; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
105 |
hb_position_t y_advance; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
106 |
hb_position_t x_offset; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
107 |
hb_position_t y_offset; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
108 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
109 |
/*< private >*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
110 |
hb_var_int_t var; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
111 |
} hb_glyph_position_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
112 |
|
40435 | 113 |
/** |
114 |
* hb_segment_properties_t: |
|
115 |
* @direction: the #hb_direction_t of the buffer, see hb_buffer_set_direction(). |
|
116 |
* @script: the #hb_script_t of the buffer, see hb_buffer_set_script(). |
|
117 |
* @language: the #hb_language_t of the buffer, see hb_buffer_set_language(). |
|
118 |
* |
|
119 |
* The structure that holds various text properties of an #hb_buffer_t. Can be |
|
120 |
* set and retrieved using hb_buffer_set_segment_properties() and |
|
121 |
* hb_buffer_get_segment_properties(), respectively. |
|
122 |
*/ |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
123 |
typedef struct hb_segment_properties_t { |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
124 |
hb_direction_t direction; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
125 |
hb_script_t script; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
126 |
hb_language_t language; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
127 |
/*< private >*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
128 |
void *reserved1; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
129 |
void *reserved2; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
130 |
} hb_segment_properties_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
131 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
132 |
#define HB_SEGMENT_PROPERTIES_DEFAULT {HB_DIRECTION_INVALID, \ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
133 |
HB_SCRIPT_INVALID, \ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
134 |
HB_LANGUAGE_INVALID, \ |
48274 | 135 |
(void *) 0, \ |
136 |
(void *) 0} |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
137 |
|
40435 | 138 |
HB_EXTERN hb_bool_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
139 |
hb_segment_properties_equal (const hb_segment_properties_t *a, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
140 |
const hb_segment_properties_t *b); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
141 |
|
40435 | 142 |
HB_EXTERN unsigned int |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
143 |
hb_segment_properties_hash (const hb_segment_properties_t *p); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
144 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
145 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
146 |
|
40435 | 147 |
/** |
148 |
* hb_buffer_t: |
|
149 |
* |
|
150 |
* The main structure holding the input text and its properties before shaping, |
|
151 |
* and output glyphs and their information after shaping. |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
152 |
*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
153 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
154 |
typedef struct hb_buffer_t hb_buffer_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
155 |
|
40435 | 156 |
HB_EXTERN hb_buffer_t * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
157 |
hb_buffer_create (void); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
158 |
|
40435 | 159 |
HB_EXTERN hb_buffer_t * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
160 |
hb_buffer_get_empty (void); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
161 |
|
40435 | 162 |
HB_EXTERN hb_buffer_t * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
163 |
hb_buffer_reference (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
164 |
|
40435 | 165 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
166 |
hb_buffer_destroy (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
167 |
|
40435 | 168 |
HB_EXTERN hb_bool_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
169 |
hb_buffer_set_user_data (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
170 |
hb_user_data_key_t *key, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
171 |
void * data, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
172 |
hb_destroy_func_t destroy, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
173 |
hb_bool_t replace); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
174 |
|
40435 | 175 |
HB_EXTERN void * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
176 |
hb_buffer_get_user_data (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
177 |
hb_user_data_key_t *key); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
178 |
|
48274 | 179 |
|
40435 | 180 |
/** |
181 |
* hb_buffer_content_type_t: |
|
182 |
* @HB_BUFFER_CONTENT_TYPE_INVALID: Initial value for new buffer. |
|
183 |
* @HB_BUFFER_CONTENT_TYPE_UNICODE: The buffer contains input characters (before shaping). |
|
184 |
* @HB_BUFFER_CONTENT_TYPE_GLYPHS: The buffer contains output glyphs (after shaping). |
|
185 |
*/ |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
186 |
typedef enum { |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
187 |
HB_BUFFER_CONTENT_TYPE_INVALID = 0, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
188 |
HB_BUFFER_CONTENT_TYPE_UNICODE, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
189 |
HB_BUFFER_CONTENT_TYPE_GLYPHS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
190 |
} hb_buffer_content_type_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
191 |
|
40435 | 192 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
193 |
hb_buffer_set_content_type (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
194 |
hb_buffer_content_type_t content_type); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
195 |
|
40435 | 196 |
HB_EXTERN hb_buffer_content_type_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
197 |
hb_buffer_get_content_type (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
198 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
199 |
|
40435 | 200 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
201 |
hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
202 |
hb_unicode_funcs_t *unicode_funcs); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
203 |
|
40435 | 204 |
HB_EXTERN hb_unicode_funcs_t * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
205 |
hb_buffer_get_unicode_funcs (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
206 |
|
40435 | 207 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
208 |
hb_buffer_set_direction (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
209 |
hb_direction_t direction); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
210 |
|
40435 | 211 |
HB_EXTERN hb_direction_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
212 |
hb_buffer_get_direction (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
213 |
|
40435 | 214 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
215 |
hb_buffer_set_script (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
216 |
hb_script_t script); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
217 |
|
40435 | 218 |
HB_EXTERN hb_script_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
219 |
hb_buffer_get_script (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
220 |
|
40435 | 221 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
222 |
hb_buffer_set_language (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
223 |
hb_language_t language); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
224 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
225 |
|
40435 | 226 |
HB_EXTERN hb_language_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
227 |
hb_buffer_get_language (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
228 |
|
40435 | 229 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
230 |
hb_buffer_set_segment_properties (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
231 |
const hb_segment_properties_t *props); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
232 |
|
40435 | 233 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
234 |
hb_buffer_get_segment_properties (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
235 |
hb_segment_properties_t *props); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
236 |
|
40435 | 237 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
238 |
hb_buffer_guess_segment_properties (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
239 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
240 |
|
40435 | 241 |
/** |
242 |
* hb_buffer_flags_t: |
|
243 |
* @HB_BUFFER_FLAG_DEFAULT: the default buffer flag. |
|
244 |
* @HB_BUFFER_FLAG_BOT: flag indicating that special handling of the beginning |
|
245 |
* of text paragraph can be applied to this buffer. Should usually |
|
246 |
* be set, unless you are passing to the buffer only part |
|
247 |
* of the text without the full context. |
|
248 |
* @HB_BUFFER_FLAG_EOT: flag indicating that special handling of the end of text |
|
249 |
* paragraph can be applied to this buffer, similar to |
|
250 |
* @HB_BUFFER_FLAG_EOT. |
|
251 |
* @HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES: |
|
252 |
* flag indication that character with Default_Ignorable |
|
253 |
* Unicode property should use the corresponding glyph |
|
254 |
* from the font, instead of hiding them (currently done |
|
255 |
* by replacing them with the space glyph and zeroing the |
|
256 |
* advance width.) |
|
257 |
* |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
258 |
* Since: 0.9.20 |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
259 |
*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
260 |
typedef enum { /*< flags >*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
261 |
HB_BUFFER_FLAG_DEFAULT = 0x00000000u, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
262 |
HB_BUFFER_FLAG_BOT = 0x00000001u, /* Beginning-of-text */ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
263 |
HB_BUFFER_FLAG_EOT = 0x00000002u, /* End-of-text */ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
264 |
HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES = 0x00000004u |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
265 |
} hb_buffer_flags_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
266 |
|
40435 | 267 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
268 |
hb_buffer_set_flags (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
269 |
hb_buffer_flags_t flags); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
270 |
|
40435 | 271 |
HB_EXTERN hb_buffer_flags_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
272 |
hb_buffer_get_flags (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
273 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
274 |
/* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
275 |
* Since: 0.9.42 |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
276 |
*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
277 |
typedef enum { |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
278 |
HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES = 0, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
279 |
HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS = 1, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
280 |
HB_BUFFER_CLUSTER_LEVEL_CHARACTERS = 2, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
281 |
HB_BUFFER_CLUSTER_LEVEL_DEFAULT = HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
282 |
} hb_buffer_cluster_level_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
283 |
|
40435 | 284 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
285 |
hb_buffer_set_cluster_level (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
286 |
hb_buffer_cluster_level_t cluster_level); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
287 |
|
40435 | 288 |
HB_EXTERN hb_buffer_cluster_level_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
289 |
hb_buffer_get_cluster_level (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
290 |
|
40435 | 291 |
/** |
292 |
* HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT: |
|
293 |
* |
|
294 |
* The default code point for replacing invalid characters in a given encoding. |
|
295 |
* Set to U+FFFD REPLACEMENT CHARACTER. |
|
296 |
* |
|
297 |
* Since: 0.9.31 |
|
298 |
*/ |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
299 |
#define HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT 0xFFFDu |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
300 |
|
40435 | 301 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
302 |
hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
303 |
hb_codepoint_t replacement); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
304 |
|
40435 | 305 |
HB_EXTERN hb_codepoint_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
306 |
hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
307 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
308 |
|
40435 | 309 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
310 |
hb_buffer_reset (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
311 |
|
40435 | 312 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
313 |
hb_buffer_clear_contents (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
314 |
|
40435 | 315 |
HB_EXTERN hb_bool_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
316 |
hb_buffer_pre_allocate (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
317 |
unsigned int size); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
318 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
319 |
|
40435 | 320 |
HB_EXTERN hb_bool_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
321 |
hb_buffer_allocation_successful (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
322 |
|
40435 | 323 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
324 |
hb_buffer_reverse (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
325 |
|
40435 | 326 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
327 |
hb_buffer_reverse_range (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
328 |
unsigned int start, unsigned int end); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
329 |
|
40435 | 330 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
331 |
hb_buffer_reverse_clusters (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
332 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
333 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
334 |
/* Filling the buffer in */ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
335 |
|
40435 | 336 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
337 |
hb_buffer_add (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
338 |
hb_codepoint_t codepoint, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
339 |
unsigned int cluster); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
340 |
|
40435 | 341 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
342 |
hb_buffer_add_utf8 (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
343 |
const char *text, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
344 |
int text_length, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
345 |
unsigned int item_offset, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
346 |
int item_length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
347 |
|
40435 | 348 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
349 |
hb_buffer_add_utf16 (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
350 |
const uint16_t *text, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
351 |
int text_length, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
352 |
unsigned int item_offset, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
353 |
int item_length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
354 |
|
40435 | 355 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
356 |
hb_buffer_add_utf32 (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
357 |
const uint32_t *text, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
358 |
int text_length, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
359 |
unsigned int item_offset, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
360 |
int item_length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
361 |
|
40435 | 362 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
363 |
hb_buffer_add_latin1 (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
364 |
const uint8_t *text, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
365 |
int text_length, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
366 |
unsigned int item_offset, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
367 |
int item_length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
368 |
|
40435 | 369 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
370 |
hb_buffer_add_codepoints (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
371 |
const hb_codepoint_t *text, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
372 |
int text_length, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
373 |
unsigned int item_offset, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
374 |
int item_length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
375 |
|
48274 | 376 |
HB_EXTERN void |
377 |
hb_buffer_append (hb_buffer_t *buffer, |
|
378 |
hb_buffer_t *source, |
|
379 |
unsigned int start, |
|
380 |
unsigned int end); |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
381 |
|
40435 | 382 |
HB_EXTERN hb_bool_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
383 |
hb_buffer_set_length (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
384 |
unsigned int length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
385 |
|
40435 | 386 |
HB_EXTERN unsigned int |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
387 |
hb_buffer_get_length (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
388 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
389 |
/* Getting glyphs out of the buffer */ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
390 |
|
40435 | 391 |
HB_EXTERN hb_glyph_info_t * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
392 |
hb_buffer_get_glyph_infos (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
393 |
unsigned int *length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
394 |
|
40435 | 395 |
HB_EXTERN hb_glyph_position_t * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
396 |
hb_buffer_get_glyph_positions (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
397 |
unsigned int *length); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
398 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
399 |
|
40435 | 400 |
HB_EXTERN void |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
401 |
hb_buffer_normalize_glyphs (hb_buffer_t *buffer); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
402 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
403 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
404 |
/* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
405 |
* Serialize |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
406 |
*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
407 |
|
40435 | 408 |
/** |
409 |
* hb_buffer_serialize_flags_t: |
|
410 |
* @HB_BUFFER_SERIALIZE_FLAG_DEFAULT: serialize glyph names, clusters and positions. |
|
411 |
* @HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS: do not serialize glyph cluster. |
|
412 |
* @HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS: do not serialize glyph position information. |
|
413 |
* @HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES: do no serialize glyph name. |
|
414 |
* @HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS: serialize glyph extents. |
|
415 |
* |
|
416 |
* Flags that control what glyph information are serialized in hb_buffer_serialize_glyphs(). |
|
417 |
* |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
418 |
* Since: 0.9.20 |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
419 |
*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
420 |
typedef enum { /*< flags >*/ |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
421 |
HB_BUFFER_SERIALIZE_FLAG_DEFAULT = 0x00000000u, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
422 |
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS = 0x00000001u, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
423 |
HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS = 0x00000002u, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
424 |
HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004u, |
48274 | 425 |
HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS = 0x00000008u, |
426 |
HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS = 0x00000010u |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
427 |
} hb_buffer_serialize_flags_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
428 |
|
40435 | 429 |
/** |
430 |
* hb_buffer_serialize_format_t: |
|
431 |
* @HB_BUFFER_SERIALIZE_FORMAT_TEXT: a human-readable, plain text format. |
|
432 |
* @HB_BUFFER_SERIALIZE_FORMAT_JSON: a machine-readable JSON format. |
|
433 |
* @HB_BUFFER_SERIALIZE_FORMAT_INVALID: invalid format. |
|
434 |
* |
|
435 |
* The buffer serialization and de-serialization format used in |
|
436 |
* hb_buffer_serialize_glyphs() and hb_buffer_deserialize_glyphs(). |
|
437 |
* |
|
438 |
* Since: 0.9.2 |
|
439 |
*/ |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
440 |
typedef enum { |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
441 |
HB_BUFFER_SERIALIZE_FORMAT_TEXT = HB_TAG('T','E','X','T'), |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
442 |
HB_BUFFER_SERIALIZE_FORMAT_JSON = HB_TAG('J','S','O','N'), |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
443 |
HB_BUFFER_SERIALIZE_FORMAT_INVALID = HB_TAG_NONE |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
444 |
} hb_buffer_serialize_format_t; |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
445 |
|
40435 | 446 |
HB_EXTERN hb_buffer_serialize_format_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
447 |
hb_buffer_serialize_format_from_string (const char *str, int len); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
448 |
|
40435 | 449 |
HB_EXTERN const char * |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
450 |
hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
451 |
|
40435 | 452 |
HB_EXTERN const char ** |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
453 |
hb_buffer_serialize_list_formats (void); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
454 |
|
40435 | 455 |
HB_EXTERN unsigned int |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
456 |
hb_buffer_serialize_glyphs (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
457 |
unsigned int start, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
458 |
unsigned int end, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
459 |
char *buf, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
460 |
unsigned int buf_size, |
40435 | 461 |
unsigned int *buf_consumed, |
462 |
hb_font_t *font, |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
463 |
hb_buffer_serialize_format_t format, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
464 |
hb_buffer_serialize_flags_t flags); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
465 |
|
40435 | 466 |
HB_EXTERN hb_bool_t |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
467 |
hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
468 |
const char *buf, |
40435 | 469 |
int buf_len, |
470 |
const char **end_ptr, |
|
471 |
hb_font_t *font, |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
472 |
hb_buffer_serialize_format_t format); |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
473 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
474 |
|
40435 | 475 |
/* |
48274 | 476 |
* Compare buffers |
477 |
*/ |
|
478 |
||
479 |
typedef enum { /*< flags >*/ |
|
480 |
HB_BUFFER_DIFF_FLAG_EQUAL = 0x0000, |
|
481 |
||
482 |
/* Buffers with different content_type cannot be meaningfully compared |
|
483 |
* in any further detail. */ |
|
484 |
HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH = 0x0001, |
|
485 |
||
486 |
/* For buffers with differing length, the per-glyph comparison is not |
|
487 |
* attempted, though we do still scan reference for dottedcircle / .notdef |
|
488 |
* glyphs. */ |
|
489 |
HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH = 0x0002, |
|
490 |
||
491 |
/* We want to know if dottedcircle / .notdef glyphs are present in the |
|
492 |
* reference, as we may not care so much about other differences in this |
|
493 |
* case. */ |
|
494 |
HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT = 0x0004, |
|
495 |
HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT = 0x0008, |
|
496 |
||
497 |
/* If the buffers have the same length, we compare them glyph-by-glyph |
|
498 |
* and report which aspect(s) of the glyph info/position are different. */ |
|
499 |
HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH = 0x0010, |
|
500 |
HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH = 0x0020, |
|
501 |
HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH = 0x0040, |
|
502 |
HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH = 0x0080 |
|
503 |
||
504 |
} hb_buffer_diff_flags_t; |
|
505 |
||
506 |
/* Compare the contents of two buffers, report types of differences. */ |
|
507 |
HB_EXTERN hb_buffer_diff_flags_t |
|
508 |
hb_buffer_diff (hb_buffer_t *buffer, |
|
509 |
hb_buffer_t *reference, |
|
510 |
hb_codepoint_t dottedcircle_glyph, |
|
511 |
unsigned int position_fuzz); |
|
512 |
||
513 |
||
514 |
/* |
|
40435 | 515 |
* Debugging. |
516 |
*/ |
|
517 |
||
518 |
typedef hb_bool_t (*hb_buffer_message_func_t) (hb_buffer_t *buffer, |
|
519 |
hb_font_t *font, |
|
520 |
const char *message, |
|
521 |
void *user_data); |
|
522 |
||
523 |
HB_EXTERN void |
|
524 |
hb_buffer_set_message_func (hb_buffer_t *buffer, |
|
525 |
hb_buffer_message_func_t func, |
|
526 |
void *user_data, hb_destroy_func_t destroy); |
|
527 |
||
528 |
||
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
529 |
HB_END_DECLS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
530 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
531 |
#endif /* HB_BUFFER_H */ |