• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
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 
56 /**
57  * HB_SCRIPT_CANADIAN_ABORIGINAL:
58  *
59  * Use #HB_SCRIPT_CANADIAN_SYLLABICS instead:
60  *
61  * Deprecated: 0.9.20
62  */
63 #define HB_SCRIPT_CANADIAN_ABORIGINAL		HB_SCRIPT_CANADIAN_SYLLABICS
64 
65 /**
66  * HB_BUFFER_FLAGS_DEFAULT:
67  *
68  * Use #HB_BUFFER_FLAG_DEFAULT instead.
69  *
70  * Deprecated: 0.9.20
71  */
72 #define HB_BUFFER_FLAGS_DEFAULT			HB_BUFFER_FLAG_DEFAULT
73 /**
74  * HB_BUFFER_SERIALIZE_FLAGS_DEFAULT:
75  *
76  * Use #HB_BUFFER_SERIALIZE_FLAG_DEFAULT instead.
77  *
78  * Deprecated: 0.9.20
79  */
80 #define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT	HB_BUFFER_SERIALIZE_FLAG_DEFAULT
81 
82 /**
83  * hb_font_get_glyph_func_t:
84  * @font: #hb_font_t to work upon
85  * @font_data: @font user data pointer
86  * @unicode: The Unicode code point to query
87  * @variation_selector: The  variation-selector code point to query
88  * @glyph: (out): The glyph ID retrieved
89  * @user_data: User data pointer passed by the caller
90  *
91  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
92  *
93  * This method should retrieve the glyph ID for a specified Unicode code point
94  * font, with an optional variation selector.
95  *
96  * Return value: %true if data found, %false otherwise
97  * Deprecated: 1.2.3
98  *
99  **/
100 typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data,
101 					       hb_codepoint_t unicode, hb_codepoint_t variation_selector,
102 					       hb_codepoint_t *glyph,
103 					       void *user_data);
104 
105 HB_EXTERN HB_DEPRECATED_FOR(hb_font_funcs_set_nominal_glyph_func and hb_font_funcs_set_variation_glyph_func) void
106 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
107 			      hb_font_get_glyph_func_t func,
108 			      void *user_data, hb_destroy_func_t destroy);
109 
110 HB_EXTERN HB_DEPRECATED void
111 hb_set_invert (hb_set_t *set);
112 
113 /**
114  * hb_unicode_eastasian_width_func_t:
115  * @ufuncs: A Unicode-functions structure
116  * @unicode: The code point to query
117  * @user_data: User data pointer passed by the caller
118  *
119  * A virtual method for the #hb_unicode_funcs_t structure.
120  *
121  * Deprecated: 2.0.0
122  */
123 typedef unsigned int			(*hb_unicode_eastasian_width_func_t)	(hb_unicode_funcs_t *ufuncs,
124 										 hb_codepoint_t      unicode,
125 										 void               *user_data);
126 
127 /**
128  * hb_unicode_funcs_set_eastasian_width_func:
129  * @ufuncs: a Unicode-function structure
130  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
131  * @user_data: Data to pass to @func
132  * @destroy: (nullable): The function to call when @user_data is not needed anymore
133  *
134  * Sets the implementation function for #hb_unicode_eastasian_width_func_t.
135  *
136  * Since: 0.9.2
137  * Deprecated: 2.0.0
138  **/
139 HB_EXTERN HB_DEPRECATED void
140 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
141 					   hb_unicode_eastasian_width_func_t func,
142 					   void *user_data, hb_destroy_func_t destroy);
143 
144 /**
145  * hb_unicode_eastasian_width:
146  * @ufuncs: a Unicode-function structure
147  * @unicode: The code point to query
148  *
149  * Don't use. Not used by HarfBuzz.
150  *
151  * Since: 0.9.2
152  * Deprecated: 2.0.0
153  **/
154 HB_EXTERN HB_DEPRECATED unsigned int
155 hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
156 			    hb_codepoint_t unicode);
157 
158 
159 /**
160  * hb_unicode_decompose_compatibility_func_t:
161  * @ufuncs: a Unicode function structure
162  * @u: codepoint to decompose
163  * @decomposed: address of codepoint array (of length #HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into
164  * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()
165  *
166  * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.
167  * The complete length of the decomposition will be returned.
168  *
169  * If @u has no compatibility decomposition, zero should be returned.
170  *
171  * The Unicode standard guarantees that a buffer of length #HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any
172  * compatibility decomposition plus an terminating value of 0.  Consequently, @decompose must be allocated by the caller to be at least this length.  Implementations
173  * of this function type must ensure that they do not write past the provided array.
174  *
175  * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
176  *
177  * Deprecated: 2.0.0
178  */
179 typedef unsigned int			(*hb_unicode_decompose_compatibility_func_t)	(hb_unicode_funcs_t *ufuncs,
180 											 hb_codepoint_t      u,
181 											 hb_codepoint_t     *decomposed,
182 											 void               *user_data);
183 
184 /**
185  * HB_UNICODE_MAX_DECOMPOSITION_LEN:
186  *
187  * See Unicode 6.1 for details on the maximum decomposition length.
188  *
189  * Deprecated: 2.0.0
190  */
191 #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
192 
193 /**
194  * hb_unicode_funcs_set_decompose_compatibility_func:
195  * @ufuncs: A Unicode-functions structure
196  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
197  * @user_data: Data to pass to @func
198  * @destroy: (nullable): The function to call when @user_data is not needed anymore
199  *
200  * Sets the implementation function for #hb_unicode_decompose_compatibility_func_t.
201  *
202  *
203  *
204  * Since: 0.9.2
205  * Deprecated: 2.0.0
206  **/
207 HB_EXTERN HB_DEPRECATED void
208 hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
209 						   hb_unicode_decompose_compatibility_func_t func,
210 						   void *user_data, hb_destroy_func_t destroy);
211 
212 HB_EXTERN HB_DEPRECATED unsigned int
213 hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
214 				    hb_codepoint_t      u,
215 				    hb_codepoint_t     *decomposed);
216 
217 
218 /**
219  * hb_font_get_glyph_v_kerning_func_t:
220  *
221  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
222  *
223  * This method should retrieve the kerning-adjustment value for a glyph-pair in
224  * the specified font, for vertical text segments.
225  *
226  **/
227 typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
228 
229 /**
230  * hb_font_funcs_set_glyph_v_kerning_func:
231  * @ffuncs: A font-function structure
232  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
233  * @user_data: Data to pass to @func
234  * @destroy: (nullable): The function to call when @user_data is not needed anymore
235  *
236  * Sets the implementation function for #hb_font_get_glyph_v_kerning_func_t.
237  *
238  * Since: 0.9.2
239  * Deprecated: 2.0.0
240  **/
241 HB_EXTERN void
242 hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
243 					hb_font_get_glyph_v_kerning_func_t func,
244 					void *user_data, hb_destroy_func_t destroy);
245 
246 HB_EXTERN hb_position_t
247 hb_font_get_glyph_v_kerning (hb_font_t *font,
248 			     hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
249 
250 #endif
251 
252 HB_END_DECLS
253 
254 #endif /* HB_DEPRECATED_H */
255