author | prr |
Fri, 01 Mar 2019 16:59:19 -0800 | |
changeset 54232 | 7c11a7cc7c1d |
parent 48274 | 51772bf1fb0c |
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 © 2013 Google, Inc. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
3 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
4 |
* This is part of HarfBuzz, a text shaping library. |
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 |
* Permission is hereby granted, without written agreement and without |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
7 |
* 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
|
8 |
* software and its documentation for any purpose, provided that the |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
9 |
* above copyright notice and the following two paragraphs appear in |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
10 |
* all copies of this software. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
11 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
12 |
* 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
|
13 |
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
14 |
* 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
|
15 |
* 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
|
16 |
* DAMAGE. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
17 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
18 |
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
19 |
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
20 |
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
21 |
* 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
|
22 |
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
23 |
* |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
24 |
* Google Author(s): Behdad Esfahbod |
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 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
27 |
#ifndef HB_H_IN |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
28 |
#error "Include <hb.h> instead." |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
29 |
#endif |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
30 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
31 |
#ifndef HB_DEPRECATED_H |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
32 |
#define HB_DEPRECATED_H |
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 |
#include "hb-common.h" |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
35 |
#include "hb-unicode.h" |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
36 |
#include "hb-font.h" |
48274 | 37 |
#include "hb-set.h" |
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
38 |
|
54232 | 39 |
|
40 |
/** |
|
41 |
* SECTION:hb-deprecated |
|
42 |
* @title: hb-deprecated |
|
43 |
* @short_description: Deprecated API |
|
44 |
* @include: hb.h |
|
45 |
* |
|
46 |
* These API have been deprecated in favor of newer API, or because they |
|
47 |
* were deemed unnecessary. |
|
48 |
**/ |
|
49 |
||
50 |
||
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
51 |
HB_BEGIN_DECLS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
52 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
53 |
#ifndef HB_DISABLE_DEPRECATED |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
54 |
|
54232 | 55 |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
56 |
#define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
57 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
58 |
#define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
59 |
#define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
60 |
|
40435 | 61 |
typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data, |
62 |
hb_codepoint_t unicode, hb_codepoint_t variation_selector, |
|
63 |
hb_codepoint_t *glyph, |
|
64 |
void *user_data); |
|
65 |
||
54232 | 66 |
HB_EXTERN HB_DEPRECATED_FOR(hb_font_funcs_set_nominal_glyph_func or hb_font_funcs_set_variation_glyph_func) void |
40435 | 67 |
hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, |
68 |
hb_font_get_glyph_func_t func, |
|
69 |
void *user_data, hb_destroy_func_t destroy); |
|
70 |
||
54232 | 71 |
HB_EXTERN HB_DEPRECATED void |
72 |
hb_set_invert (hb_set_t *set); |
|
73 |
||
74 |
/** |
|
75 |
* hb_unicode_eastasian_width_func_t: |
|
76 |
* |
|
77 |
* Deprecated: 2.0.0 |
|
78 |
*/ |
|
79 |
typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs, |
|
80 |
hb_codepoint_t unicode, |
|
81 |
void *user_data); |
|
82 |
||
83 |
/** |
|
84 |
* hb_unicode_funcs_set_eastasian_width_func: |
|
85 |
* @ufuncs: a Unicode function structure |
|
86 |
* @func: (closure user_data) (destroy destroy) (scope notified): |
|
87 |
* @user_data: |
|
88 |
* @destroy: |
|
89 |
* |
|
90 |
* |
|
91 |
* |
|
92 |
* Since: 0.9.2 |
|
93 |
* Deprecated: 2.0.0 |
|
94 |
**/ |
|
95 |
HB_EXTERN HB_DEPRECATED void |
|
96 |
hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs, |
|
97 |
hb_unicode_eastasian_width_func_t func, |
|
98 |
void *user_data, hb_destroy_func_t destroy); |
|
99 |
||
100 |
/** |
|
101 |
* hb_unicode_eastasian_width: |
|
102 |
* |
|
103 |
* Since: 0.9.2 |
|
104 |
* Deprecated: 2.0.0 |
|
105 |
**/ |
|
106 |
HB_EXTERN HB_DEPRECATED unsigned int |
|
107 |
hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs, |
|
108 |
hb_codepoint_t unicode); |
|
109 |
||
110 |
||
111 |
/** |
|
112 |
* hb_unicode_decompose_compatibility_func_t: |
|
113 |
* @ufuncs: a Unicode function structure |
|
114 |
* @u: codepoint to decompose |
|
115 |
* @decomposed: address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into |
|
116 |
* @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func() |
|
117 |
* |
|
118 |
* Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed. |
|
119 |
* The complete length of the decomposition will be returned. |
|
120 |
* |
|
121 |
* If @u has no compatibility decomposition, zero should be returned. |
|
122 |
* |
|
123 |
* The Unicode standard guarantees that a buffer of length %HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any |
|
124 |
* compatibility decomposition plus an terminating value of 0. Consequently, @decompose must be allocated by the caller to be at least this length. Implementations |
|
125 |
* of this function type must ensure that they do not write past the provided array. |
|
126 |
* |
|
127 |
* Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available. |
|
128 |
* |
|
129 |
* Deprecated: 2.0.0 |
|
130 |
*/ |
|
131 |
typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_funcs_t *ufuncs, |
|
132 |
hb_codepoint_t u, |
|
133 |
hb_codepoint_t *decomposed, |
|
134 |
void *user_data); |
|
135 |
||
136 |
/** |
|
137 |
* HB_UNICODE_MAX_DECOMPOSITION_LEN: |
|
138 |
* |
|
139 |
* See Unicode 6.1 for details on the maximum decomposition length. |
|
140 |
* |
|
141 |
* Deprecated: 2.0.0 |
|
142 |
*/ |
|
143 |
#define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */ |
|
144 |
||
145 |
/** |
|
146 |
* hb_unicode_funcs_set_decompose_compatibility_func: |
|
147 |
* @ufuncs: a Unicode function structure |
|
148 |
* @func: (closure user_data) (destroy destroy) (scope notified): |
|
149 |
* @user_data: |
|
150 |
* @destroy: |
|
151 |
* |
|
152 |
* |
|
153 |
* |
|
154 |
* Since: 0.9.2 |
|
155 |
* Deprecated: 2.0.0 |
|
156 |
**/ |
|
157 |
HB_EXTERN HB_DEPRECATED void |
|
158 |
hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs, |
|
159 |
hb_unicode_decompose_compatibility_func_t func, |
|
160 |
void *user_data, hb_destroy_func_t destroy); |
|
161 |
||
162 |
HB_EXTERN HB_DEPRECATED unsigned int |
|
163 |
hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, |
|
164 |
hb_codepoint_t u, |
|
165 |
hb_codepoint_t *decomposed); |
|
166 |
||
167 |
||
168 |
typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data, |
|
169 |
hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, |
|
170 |
void *user_data); |
|
171 |
typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t; |
|
172 |
typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t; |
|
173 |
||
174 |
/** |
|
175 |
* hb_font_funcs_set_glyph_h_kerning_func: |
|
176 |
* @ffuncs: font functions. |
|
177 |
* @func: (closure user_data) (destroy destroy) (scope notified): |
|
178 |
* @user_data: |
|
179 |
* @destroy: |
|
180 |
* |
|
181 |
* |
|
182 |
* |
|
183 |
* Since: 0.9.2 |
|
184 |
* Deprecated: 2.0.0 |
|
185 |
**/ |
|
48274 | 186 |
HB_EXTERN void |
54232 | 187 |
hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, |
188 |
hb_font_get_glyph_h_kerning_func_t func, |
|
189 |
void *user_data, hb_destroy_func_t destroy); |
|
190 |
||
191 |
/** |
|
192 |
* hb_font_funcs_set_glyph_v_kerning_func: |
|
193 |
* @ffuncs: font functions. |
|
194 |
* @func: (closure user_data) (destroy destroy) (scope notified): |
|
195 |
* @user_data: |
|
196 |
* @destroy: |
|
197 |
* |
|
198 |
* |
|
199 |
* |
|
200 |
* Since: 0.9.2 |
|
201 |
* Deprecated: 2.0.0 |
|
202 |
**/ |
|
203 |
HB_EXTERN void |
|
204 |
hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, |
|
205 |
hb_font_get_glyph_v_kerning_func_t func, |
|
206 |
void *user_data, hb_destroy_func_t destroy); |
|
207 |
||
208 |
HB_EXTERN hb_position_t |
|
209 |
hb_font_get_glyph_h_kerning (hb_font_t *font, |
|
210 |
hb_codepoint_t left_glyph, hb_codepoint_t right_glyph); |
|
211 |
HB_EXTERN hb_position_t |
|
212 |
hb_font_get_glyph_v_kerning (hb_font_t *font, |
|
213 |
hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph); |
|
214 |
||
215 |
HB_EXTERN void |
|
216 |
hb_font_get_glyph_kerning_for_direction (hb_font_t *font, |
|
217 |
hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, |
|
218 |
hb_direction_t direction, |
|
219 |
hb_position_t *x, hb_position_t *y); |
|
220 |
||
48274 | 221 |
|
34414
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
222 |
#endif |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
223 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
224 |
HB_END_DECLS |
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
225 |
|
e496a8d8fc8a
8143177: Integrate harfbuzz opentype layout engine per JEP 258
prr
parents:
diff
changeset
|
226 |
#endif /* HB_DEPRECATED_H */ |