1 | /* |
2 | * Copyright © 2013 Google, Inc. |
3 | * |
4 | * This is part of HarfBuzz, a text shaping library. |
5 | * |
6 | * Permission is hereby granted, without written agreement and without |
7 | * license or royalty fees, to use, copy, modify, and distribute this |
8 | * software and its documentation for any purpose, provided that the |
9 | * above copyright notice and the following two paragraphs appear in |
10 | * all copies of this software. |
11 | * |
12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
16 | * DAMAGE. |
17 | * |
18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
23 | * |
24 | * Google Author(s): Behdad Esfahbod |
25 | */ |
26 | |
27 | #ifndef HB_H_IN |
28 | #error "Include <hb.h> instead." |
29 | #endif |
30 | |
31 | #ifndef HB_DEPRECATED_H |
32 | #define HB_DEPRECATED_H |
33 | |
34 | #include "hb-common.h" |
35 | #include "hb-unicode.h" |
36 | #include "hb-font.h" |
37 | #include "hb-set.h" |
38 | |
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 | |
51 | HB_BEGIN_DECLS |
52 | |
53 | #ifndef HB_DISABLE_DEPRECATED |
54 | |
55 | #define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS |
56 | |
57 | #define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT |
58 | #define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT |
59 | |
60 | typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data, |
61 | hb_codepoint_t unicode, hb_codepoint_t variation_selector, |
62 | hb_codepoint_t *glyph, |
63 | void *user_data); |
64 | |
65 | HB_EXTERN HB_DEPRECATED_FOR(hb_font_funcs_set_nominal_glyph_func or hb_font_funcs_set_variation_glyph_func) void |
66 | hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, |
67 | hb_font_get_glyph_func_t func, |
68 | void *user_data, hb_destroy_func_t destroy); |
69 | |
70 | HB_EXTERN HB_DEPRECATED void |
71 | hb_set_invert (hb_set_t *set); |
72 | |
73 | /** |
74 | * hb_unicode_eastasian_width_func_t: |
75 | * |
76 | * Deprecated: 2.0.0 |
77 | */ |
78 | typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs, |
79 | hb_codepoint_t unicode, |
80 | void *user_data); |
81 | |
82 | /** |
83 | * hb_unicode_funcs_set_eastasian_width_func: |
84 | * @ufuncs: a Unicode function structure |
85 | * @func: (closure user_data) (destroy destroy) (scope notified): |
86 | * @user_data: |
87 | * @destroy: |
88 | * |
89 | * |
90 | * |
91 | * Since: 0.9.2 |
92 | * Deprecated: 2.0.0 |
93 | **/ |
94 | HB_EXTERN HB_DEPRECATED void |
95 | hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs, |
96 | hb_unicode_eastasian_width_func_t func, |
97 | void *user_data, hb_destroy_func_t destroy); |
98 | |
99 | /** |
100 | * hb_unicode_eastasian_width: |
101 | * |
102 | * Since: 0.9.2 |
103 | * Deprecated: 2.0.0 |
104 | **/ |
105 | HB_EXTERN HB_DEPRECATED unsigned int |
106 | hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs, |
107 | hb_codepoint_t unicode); |
108 | |
109 | |
110 | /** |
111 | * hb_unicode_decompose_compatibility_func_t: |
112 | * @ufuncs: a Unicode function structure |
113 | * @u: codepoint to decompose |
114 | * @decomposed: address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into |
115 | * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func() |
116 | * |
117 | * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed. |
118 | * The complete length of the decomposition will be returned. |
119 | * |
120 | * If @u has no compatibility decomposition, zero should be returned. |
121 | * |
122 | * The Unicode standard guarantees that a buffer of length %HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any |
123 | * compatibility decomposition plus an terminating value of 0. Consequently, @decompose must be allocated by the caller to be at least this length. Implementations |
124 | * of this function type must ensure that they do not write past the provided array. |
125 | * |
126 | * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available. |
127 | * |
128 | * Deprecated: 2.0.0 |
129 | */ |
130 | typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_funcs_t *ufuncs, |
131 | hb_codepoint_t u, |
132 | hb_codepoint_t *decomposed, |
133 | void *user_data); |
134 | |
135 | /** |
136 | * HB_UNICODE_MAX_DECOMPOSITION_LEN: |
137 | * |
138 | * See Unicode 6.1 for details on the maximum decomposition length. |
139 | * |
140 | * Deprecated: 2.0.0 |
141 | */ |
142 | #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */ |
143 | |
144 | /** |
145 | * hb_unicode_funcs_set_decompose_compatibility_func: |
146 | * @ufuncs: a Unicode function structure |
147 | * @func: (closure user_data) (destroy destroy) (scope notified): |
148 | * @user_data: |
149 | * @destroy: |
150 | * |
151 | * |
152 | * |
153 | * Since: 0.9.2 |
154 | * Deprecated: 2.0.0 |
155 | **/ |
156 | HB_EXTERN HB_DEPRECATED void |
157 | hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs, |
158 | hb_unicode_decompose_compatibility_func_t func, |
159 | void *user_data, hb_destroy_func_t destroy); |
160 | |
161 | HB_EXTERN HB_DEPRECATED unsigned int |
162 | hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, |
163 | hb_codepoint_t u, |
164 | hb_codepoint_t *decomposed); |
165 | |
166 | |
167 | typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data, |
168 | hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, |
169 | void *user_data); |
170 | typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t; |
171 | typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t; |
172 | |
173 | /** |
174 | * hb_font_funcs_set_glyph_h_kerning_func: |
175 | * @ffuncs: font functions. |
176 | * @func: (closure user_data) (destroy destroy) (scope notified): |
177 | * @user_data: |
178 | * @destroy: |
179 | * |
180 | * |
181 | * |
182 | * Since: 0.9.2 |
183 | * Deprecated: 2.0.0 |
184 | **/ |
185 | HB_EXTERN void |
186 | hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, |
187 | hb_font_get_glyph_h_kerning_func_t func, |
188 | void *user_data, hb_destroy_func_t destroy); |
189 | |
190 | /** |
191 | * hb_font_funcs_set_glyph_v_kerning_func: |
192 | * @ffuncs: font functions. |
193 | * @func: (closure user_data) (destroy destroy) (scope notified): |
194 | * @user_data: |
195 | * @destroy: |
196 | * |
197 | * |
198 | * |
199 | * Since: 0.9.2 |
200 | * Deprecated: 2.0.0 |
201 | **/ |
202 | HB_EXTERN void |
203 | hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, |
204 | hb_font_get_glyph_v_kerning_func_t func, |
205 | void *user_data, hb_destroy_func_t destroy); |
206 | |
207 | HB_EXTERN hb_position_t |
208 | hb_font_get_glyph_h_kerning (hb_font_t *font, |
209 | hb_codepoint_t left_glyph, hb_codepoint_t right_glyph); |
210 | HB_EXTERN hb_position_t |
211 | hb_font_get_glyph_v_kerning (hb_font_t *font, |
212 | hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph); |
213 | |
214 | HB_EXTERN void |
215 | hb_font_get_glyph_kerning_for_direction (hb_font_t *font, |
216 | hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, |
217 | hb_direction_t direction, |
218 | hb_position_t *x, hb_position_t *y); |
219 | |
220 | /* Like hb_ot_layout_table_find_script, but takes zero-terminated array of scripts to test */ |
221 | HB_EXTERN HB_DEPRECATED_FOR (hb_ot_layout_table_select_script) hb_bool_t |
222 | hb_ot_layout_table_choose_script (hb_face_t *face, |
223 | hb_tag_t table_tag, |
224 | const hb_tag_t *script_tags, |
225 | unsigned int *script_index, |
226 | hb_tag_t *chosen_script); |
227 | |
228 | HB_EXTERN HB_DEPRECATED_FOR (hb_ot_layout_script_select_language) hb_bool_t |
229 | hb_ot_layout_script_find_language (hb_face_t *face, |
230 | hb_tag_t table_tag, |
231 | unsigned int script_index, |
232 | hb_tag_t language_tag, |
233 | unsigned int *language_index); |
234 | |
235 | HB_EXTERN HB_DEPRECATED_FOR (hb_ot_tags_from_script_and_language) void |
236 | hb_ot_tags_from_script (hb_script_t script, |
237 | hb_tag_t *script_tag_1, |
238 | hb_tag_t *script_tag_2); |
239 | |
240 | HB_EXTERN HB_DEPRECATED_FOR (hb_ot_tags_from_script_and_language) hb_tag_t |
241 | hb_ot_tag_from_language (hb_language_t language); |
242 | |
243 | |
244 | typedef unsigned int hb_ot_name_id_t; /* Since is in hb-ot.h */ |
245 | |
246 | /** |
247 | * HB_OT_VAR_NO_AXIS_INDEX: |
248 | * |
249 | * Since: 1.4.2 |
250 | * Deprecated: 2.2.0 |
251 | */ |
252 | #define HB_OT_VAR_NO_AXIS_INDEX 0xFFFFFFFFu |
253 | |
254 | /** |
255 | * hb_ot_var_axis_t: |
256 | * |
257 | * Since: 1.4.2 |
258 | * Deprecated: 2.2.0 |
259 | */ |
260 | typedef struct hb_ot_var_axis_t |
261 | { |
262 | hb_tag_t tag; |
263 | hb_ot_name_id_t name_id; |
264 | float min_value; |
265 | float default_value; |
266 | float max_value; |
267 | } hb_ot_var_axis_t; |
268 | |
269 | HB_EXTERN HB_DEPRECATED_FOR (hb_ot_var_get_axis_infos) unsigned int |
270 | hb_ot_var_get_axes (hb_face_t *face, |
271 | unsigned int start_offset, |
272 | unsigned int *axes_count /* IN/OUT */, |
273 | hb_ot_var_axis_t *axes_array /* OUT */); |
274 | |
275 | HB_EXTERN HB_DEPRECATED_FOR (hb_ot_var_find_axis_info) hb_bool_t |
276 | hb_ot_var_find_axis (hb_face_t *face, |
277 | hb_tag_t axis_tag, |
278 | unsigned int *axis_index, |
279 | hb_ot_var_axis_t *axis_info); |
280 | |
281 | #endif |
282 | |
283 | HB_END_DECLS |
284 | |
285 | #endif /* HB_DEPRECATED_H */ |
286 | |