tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

hb-deprecated.h (13343B)


      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_DEPRECATED_FOR (hb_font_funcs_set_nominal_glyph_func and hb_font_funcs_set_variation_glyph_func)
    106 HB_EXTERN void
    107 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
    108 		      hb_font_get_glyph_func_t func,
    109 		      void *user_data, hb_destroy_func_t destroy);
    110 
    111 /* https://github.com/harfbuzz/harfbuzz/pull/4207 */
    112 /**
    113 * HB_UNICODE_COMBINING_CLASS_CCC133:
    114 *
    115 * [Tibetan]
    116 *
    117 * Deprecated: 7.2.0
    118 **/
    119 #define HB_UNICODE_COMBINING_CLASS_CCC133 133
    120 
    121 /**
    122 * hb_unicode_eastasian_width_func_t:
    123 * @ufuncs: A Unicode-functions structure
    124 * @unicode: The code point to query
    125 * @user_data: User data pointer passed by the caller
    126 *
    127 * A virtual method for the #hb_unicode_funcs_t structure.
    128 *
    129 * Deprecated: 2.0.0
    130 */
    131 typedef unsigned int			(*hb_unicode_eastasian_width_func_t)	(hb_unicode_funcs_t *ufuncs,
    132 									 hb_codepoint_t      unicode,
    133 									 void               *user_data);
    134 
    135 /**
    136 * hb_unicode_funcs_set_eastasian_width_func:
    137 * @ufuncs: a Unicode-function structure
    138 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    139 * @user_data: Data to pass to @func
    140 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    141 *
    142 * Sets the implementation function for #hb_unicode_eastasian_width_func_t.
    143 *
    144 * Since: 0.9.2
    145 * Deprecated: 2.0.0
    146 **/
    147 HB_EXTERN HB_DEPRECATED void
    148 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
    149 				   hb_unicode_eastasian_width_func_t func,
    150 				   void *user_data, hb_destroy_func_t destroy);
    151 
    152 /**
    153 * hb_unicode_eastasian_width:
    154 * @ufuncs: a Unicode-function structure
    155 * @unicode: The code point to query
    156 *
    157 * Don't use. Not used by HarfBuzz.
    158 *
    159 * Since: 0.9.2
    160 * Deprecated: 2.0.0
    161 **/
    162 HB_EXTERN HB_DEPRECATED unsigned int
    163 hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
    164 		    hb_codepoint_t unicode);
    165 
    166 
    167 /**
    168 * hb_unicode_decompose_compatibility_func_t:
    169 * @ufuncs: a Unicode function structure
    170 * @u: codepoint to decompose
    171 * @decomposed: address of codepoint array (of length #HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into
    172 * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()
    173 *
    174 * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.
    175 * The complete length of the decomposition will be returned.
    176 *
    177 * If @u has no compatibility decomposition, zero should be returned.
    178 *
    179 * The Unicode standard guarantees that a buffer of length #HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any
    180 * compatibility decomposition plus an terminating value of 0.  Consequently, @decompose must be allocated by the caller to be at least this length.  Implementations
    181 * of this function type must ensure that they do not write past the provided array.
    182 *
    183 * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
    184 *
    185 * Deprecated: 2.0.0
    186 */
    187 typedef unsigned int			(*hb_unicode_decompose_compatibility_func_t)	(hb_unicode_funcs_t *ufuncs,
    188 										 hb_codepoint_t      u,
    189 										 hb_codepoint_t     *decomposed,
    190 										 void               *user_data);
    191 
    192 /**
    193 * HB_UNICODE_MAX_DECOMPOSITION_LEN:
    194 *
    195 * See Unicode 6.1 for details on the maximum decomposition length.
    196 *
    197 * Deprecated: 2.0.0
    198 */
    199 #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
    200 
    201 /**
    202 * hb_unicode_funcs_set_decompose_compatibility_func:
    203 * @ufuncs: A Unicode-functions structure
    204 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    205 * @user_data: Data to pass to @func
    206 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    207 *
    208 * Sets the implementation function for #hb_unicode_decompose_compatibility_func_t.
    209 *
    210 * 
    211 *
    212 * Since: 0.9.2
    213 * Deprecated: 2.0.0
    214 **/
    215 HB_EXTERN HB_DEPRECATED void
    216 hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
    217 					   hb_unicode_decompose_compatibility_func_t func,
    218 					   void *user_data, hb_destroy_func_t destroy);
    219 
    220 HB_EXTERN HB_DEPRECATED unsigned int
    221 hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
    222 			    hb_codepoint_t      u,
    223 			    hb_codepoint_t     *decomposed);
    224 
    225 
    226 /**
    227 * hb_font_get_glyph_v_kerning_func_t:
    228 *
    229 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    230 *
    231 * This method should retrieve the kerning-adjustment value for a glyph-pair in
    232 * the specified font, for vertical text segments.
    233 *
    234 **/
    235 typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
    236 
    237 /**
    238 * hb_font_funcs_set_glyph_v_kerning_func:
    239 * @ffuncs: A font-function structure
    240 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    241 * @user_data: Data to pass to @func
    242 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    243 *
    244 * Sets the implementation function for #hb_font_get_glyph_v_kerning_func_t.
    245 *
    246 * Since: 0.9.2
    247 * Deprecated: 2.0.0
    248 **/
    249 HB_EXTERN void
    250 hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
    251 				hb_font_get_glyph_v_kerning_func_t func,
    252 				void *user_data, hb_destroy_func_t destroy);
    253 
    254 HB_EXTERN hb_position_t
    255 hb_font_get_glyph_v_kerning (hb_font_t *font,
    256 		     hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
    257 
    258 
    259 /**
    260 * hb_font_get_glyph_shape_func_t:
    261 * @font: #hb_font_t to work upon
    262 * @font_data: @font user data pointer
    263 * @glyph: The glyph ID to query
    264 * @draw_funcs: The draw functions to send the shape data to
    265 * @draw_data: The data accompanying the draw functions
    266 * @user_data: User data pointer passed by the caller
    267 *
    268 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    269 *
    270 * Since: 4.0.0
    271 * Deprecated: 7.0.0: Use #hb_font_draw_glyph_func_t instead
    272 **/
    273 typedef void (*hb_font_get_glyph_shape_func_t) (hb_font_t *font, void *font_data,
    274 					hb_codepoint_t glyph,
    275 					hb_draw_funcs_t *draw_funcs, void *draw_data,
    276 					void *user_data);
    277 
    278 /**
    279 * hb_font_draw_glyph_func_t:
    280 * @font: #hb_font_t to work upon
    281 * @font_data: @font user data pointer
    282 * @glyph: The glyph ID to query
    283 * @draw_funcs: The draw functions to send the shape data to
    284 * @draw_data: The data accompanying the draw functions
    285 * @user_data: User data pointer passed by the caller
    286 *
    287 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    288 *
    289 * Since: 7.0.0
    290 * Deprecated: 11.2.0: Use hb_font_draw_glyph_func_or_fail_t instead.
    291 **/
    292 typedef void (*hb_font_draw_glyph_func_t) (hb_font_t *font, void *font_data,
    293                                           hb_codepoint_t glyph,
    294                                           hb_draw_funcs_t *draw_funcs, void *draw_data,
    295                                           void *user_data);
    296 
    297 /**
    298 * hb_font_paint_glyph_func_t:
    299 * @font: #hb_font_t to work upon
    300 * @font_data: @font user data pointer
    301 * @glyph: The glyph ID to query
    302 * @paint_funcs: The paint functions to use
    303 * @paint_data: The data accompanying the paint functions
    304 * @palette_index: The color palette to use
    305 * @foreground: The foreground color
    306 * @user_data: User data pointer passed by the caller
    307 *
    308 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    309 *
    310 * Since: 7.0.0
    311 * Deprecated: 11.2.0: Use hb_font_paint_glyph_or_fail_func_t instead.
    312 */
    313 typedef hb_bool_t (*hb_font_paint_glyph_func_t) (hb_font_t *font, void *font_data,
    314 					 hb_codepoint_t glyph,
    315 					 hb_paint_funcs_t *paint_funcs, void *paint_data,
    316 					 unsigned int palette_index,
    317 					 hb_color_t foreground,
    318 					 void *user_data);
    319 
    320 /**
    321 * hb_font_funcs_set_glyph_shape_func:
    322 * @ffuncs: A font-function structure
    323 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    324 * @user_data: Data to pass to @func
    325 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    326 *
    327 * Sets the implementation function for #hb_font_get_glyph_shape_func_t,
    328 * which is the same as #hb_font_draw_glyph_func_t.
    329 *
    330 * Since: 4.0.0
    331 * Deprecated: 7.0.0: Use hb_font_funcs_set_draw_glyph_func() instead
    332 **/
    333 HB_DEPRECATED_FOR (hb_font_funcs_set_draw_glyph_or_fail_func)
    334 HB_EXTERN void
    335 hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
    336 			    hb_font_get_glyph_shape_func_t func,
    337 			    void *user_data, hb_destroy_func_t destroy);
    338 
    339 /**
    340 * hb_font_funcs_set_draw_glyph_func:
    341 * @ffuncs: A font-function structure
    342 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    343 * @user_data: Data to pass to @func
    344 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    345 *
    346 * Sets the implementation function for #hb_font_draw_glyph_func_t.
    347 *
    348 * Since: 7.0.0
    349 * Deprecated: 11.2.0: Use hb_font_funcs_set_draw_glyph_or_fail_func instead.
    350 **/
    351 HB_DEPRECATED_FOR (hb_font_funcs_set_draw_glyph_or_fail_func)
    352 HB_EXTERN void
    353 hb_font_funcs_set_draw_glyph_func (hb_font_funcs_t *ffuncs,
    354                                   hb_font_draw_glyph_func_t func,
    355                                   void *user_data, hb_destroy_func_t destroy);
    356 
    357 /**
    358 * hb_font_funcs_set_paint_glyph_func:
    359 * @ffuncs: A font-function structure
    360 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    361 * @user_data: Data to pass to @func
    362 * @destroy: (nullable): The function to call when @user_data is no longer needed
    363 *
    364 * Sets the implementation function for #hb_font_paint_glyph_func_t.
    365 *
    366 * Since: 7.0.0
    367 * Deprecated: 11.2.0: Use hb_font_funcs_set_paint_glyph_or_fail_func() instead.
    368 */
    369 HB_DEPRECATED_FOR (hb_font_funcs_set_paint_glyph_or_fail_func)
    370 HB_EXTERN void
    371 hb_font_funcs_set_paint_glyph_func (hb_font_funcs_t *ffuncs,
    372                                    hb_font_paint_glyph_func_t func,
    373                                    void *user_data, hb_destroy_func_t destroy);
    374 
    375 HB_DEPRECATED_FOR (hb_font_draw_glyph_or_fail)
    376 HB_EXTERN void
    377 hb_font_get_glyph_shape (hb_font_t *font,
    378 		 hb_codepoint_t glyph,
    379 		 hb_draw_funcs_t *dfuncs, void *draw_data);
    380 
    381 
    382 /**
    383 * HB_AAT_LAYOUT_FEATURE_TYPE_CURISVE_CONNECTION:
    384 *
    385 * Use #HB_AAT_LAYOUT_FEATURE_TYPE_CURSIVE_CONNECTION instead.
    386 *
    387 * Deprecated: 8.3.0
    388 */
    389 #define HB_AAT_LAYOUT_FEATURE_TYPE_CURISVE_CONNECTION HB_AAT_LAYOUT_FEATURE_TYPE_CURSIVE_CONNECTION
    390 
    391 #endif
    392 
    393 
    394 HB_END_DECLS
    395 
    396 #endif /* HB_DEPRECATED_H */