2 * Copyright © 2013 Google, Inc.
4 * This is part of HarfBuzz, a text shaping library.
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.
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
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.
24 * Google Author(s): Behdad Esfahbod
28 #error "Include <hb.h> instead."
31 #ifndef HB_DEPRECATED_H
32 #define HB_DEPRECATED_H
34 #include "hb-common.h"
35 #include "hb-unicode.h"
41 * SECTION:hb-deprecated
42 * @title: hb-deprecated
43 * @short_description: Deprecated API
46 * These API have been deprecated in favor of newer API, or because they
47 * were deemed unnecessary.
53 #ifndef HB_DISABLE_DEPRECATED
56 #define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS
58 #define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT
59 #define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT
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,
66 HB_EXTERN HB_DEPRECATED_FOR(hb_font_funcs_set_nominal_glyph_func or hb_font_funcs_set_variation_glyph_func) void
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);
71 HB_EXTERN HB_DEPRECATED void
72 hb_set_invert (hb_set_t *set);
75 * hb_unicode_eastasian_width_func_t:
79 typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs,
80 hb_codepoint_t unicode,
84 * hb_unicode_funcs_set_eastasian_width_func:
85 * @ufuncs: a Unicode function structure
86 * @func: (closure user_data) (destroy destroy) (scope notified):
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);
101 * hb_unicode_eastasian_width:
106 HB_EXTERN HB_DEPRECATED unsigned int
107 hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
108 hb_codepoint_t unicode);
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()
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.
121 * If @u has no compatibility decomposition, zero should be returned.
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.
127 * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
131 typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_funcs_t *ufuncs,
133 hb_codepoint_t *decomposed,
137 * HB_UNICODE_MAX_DECOMPOSITION_LEN:
139 * See Unicode 6.1 for details on the maximum decomposition length.
143 #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
146 * hb_unicode_funcs_set_decompose_compatibility_func:
147 * @ufuncs: a Unicode function structure
148 * @func: (closure user_data) (destroy destroy) (scope notified):
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);
162 HB_EXTERN HB_DEPRECATED unsigned int
163 hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
165 hb_codepoint_t *decomposed);
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,
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;
175 * hb_font_funcs_set_glyph_h_kerning_func:
176 * @ffuncs: font functions.
177 * @func: (closure user_data) (destroy destroy) (scope notified):
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);
192 * hb_font_funcs_set_glyph_v_kerning_func:
193 * @ffuncs: font functions.
194 * @func: (closure user_data) (destroy destroy) (scope notified):
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);
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);
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);
226 #endif /* HB_DEPRECATED_H */