tor-browser

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

hb-font.h (41731B)


      1 /*
      2 * Copyright © 2009  Red Hat, 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 * Red Hat 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_FONT_H
     32 #define HB_FONT_H
     33 
     34 #include "hb-common.h"
     35 #include "hb-face.h"
     36 #include "hb-draw.h"
     37 #include "hb-paint.h"
     38 
     39 HB_BEGIN_DECLS
     40 
     41 /*
     42 * hb_font_funcs_t
     43 */
     44 
     45 /**
     46 * hb_font_funcs_t:
     47 *
     48 * Data type containing a set of virtual methods used for
     49 * working on #hb_font_t font objects.
     50 *
     51 * HarfBuzz provides a lightweight default function for each of 
     52 * the methods in #hb_font_funcs_t. Client programs can implement
     53 * their own replacements for the individual font functions, as
     54 * needed, and replace the default by calling the setter for a
     55 * method.
     56 *
     57 **/
     58 typedef struct hb_font_funcs_t hb_font_funcs_t;
     59 
     60 HB_EXTERN hb_font_funcs_t *
     61 hb_font_funcs_create (void);
     62 
     63 HB_EXTERN hb_font_funcs_t *
     64 hb_font_funcs_get_empty (void);
     65 
     66 HB_EXTERN hb_font_funcs_t *
     67 hb_font_funcs_reference (hb_font_funcs_t *ffuncs);
     68 
     69 HB_EXTERN void
     70 hb_font_funcs_destroy (hb_font_funcs_t *ffuncs);
     71 
     72 HB_EXTERN hb_bool_t
     73 hb_font_funcs_set_user_data (hb_font_funcs_t    *ffuncs,
     74 		     hb_user_data_key_t *key,
     75 		     void *              data,
     76 		     hb_destroy_func_t   destroy,
     77 		     hb_bool_t           replace);
     78 
     79 
     80 HB_EXTERN void *
     81 hb_font_funcs_get_user_data (const hb_font_funcs_t *ffuncs,
     82 		     hb_user_data_key_t    *key);
     83 
     84 
     85 HB_EXTERN void
     86 hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);
     87 
     88 HB_EXTERN hb_bool_t
     89 hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs);
     90 
     91 
     92 /* font extents */
     93 
     94 /**
     95 * hb_font_extents_t:
     96 * @ascender: The height of typographic ascenders.
     97 * @descender: The depth of typographic descenders.
     98 * @line_gap: The suggested line-spacing gap.
     99 *
    100 * Font-wide extent values, measured in scaled units.
    101 *
    102 * Note that typically @ascender is positive and @descender
    103 * negative, in coordinate systems that grow up.
    104 **/
    105 typedef struct hb_font_extents_t {
    106  hb_position_t ascender;
    107  hb_position_t descender;
    108  hb_position_t line_gap;
    109  /*< private >*/
    110  hb_position_t reserved9;
    111  hb_position_t reserved8;
    112  hb_position_t reserved7;
    113  hb_position_t reserved6;
    114  hb_position_t reserved5;
    115  hb_position_t reserved4;
    116  hb_position_t reserved3;
    117  hb_position_t reserved2;
    118  hb_position_t reserved1;
    119 } hb_font_extents_t;
    120 
    121 /* func types */
    122 
    123 /**
    124 * hb_font_get_font_extents_func_t:
    125 * @font: #hb_font_t to work upon
    126 * @font_data: @font user data pointer
    127 * @extents: (out): The font extents retrieved
    128 * @user_data: User data pointer passed by the caller
    129 *
    130 * This method should retrieve the extents for a font.
    131 *
    132 **/
    133 typedef hb_bool_t (*hb_font_get_font_extents_func_t) (hb_font_t *font, void *font_data,
    134 					       hb_font_extents_t *extents,
    135 					       void *user_data);
    136 
    137 /**
    138 * hb_font_get_font_h_extents_func_t:
    139 *
    140 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    141 *
    142 * This method should retrieve the extents for a font, for horizontal-direction
    143 * text segments. Extents must be returned in an #hb_glyph_extents output
    144 * parameter.
    145 * 
    146 **/
    147 typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t;
    148 
    149 /**
    150 * hb_font_get_font_v_extents_func_t:
    151 *
    152 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    153 *
    154 * This method should retrieve the extents for a font, for vertical-direction
    155 * text segments. Extents must be returned in an #hb_glyph_extents output
    156 * parameter.
    157 * 
    158 **/
    159 typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t;
    160 
    161 
    162 /**
    163 * hb_font_get_nominal_glyph_func_t:
    164 * @font: #hb_font_t to work upon
    165 * @font_data: @font user data pointer
    166 * @unicode: The Unicode code point to query
    167 * @glyph: (out): The glyph ID retrieved
    168 * @user_data: User data pointer passed by the caller
    169 *
    170 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    171 *
    172 * This method should retrieve the nominal glyph ID for a specified Unicode code
    173 * point. Glyph IDs must be returned in a #hb_codepoint_t output parameter.
    174 * 
    175 * Return value: `true` if data found, `false` otherwise
    176 *
    177 **/
    178 typedef hb_bool_t (*hb_font_get_nominal_glyph_func_t) (hb_font_t *font, void *font_data,
    179 					       hb_codepoint_t unicode,
    180 					       hb_codepoint_t *glyph,
    181 					       void *user_data);
    182 
    183 /**
    184 * hb_font_get_variation_glyph_func_t:
    185 * @font: #hb_font_t to work upon
    186 * @font_data: @font user data pointer
    187 * @unicode: The Unicode code point to query
    188 * @variation_selector: The  variation-selector code point to query
    189 * @glyph: (out): The glyph ID retrieved
    190 * @user_data: User data pointer passed by the caller
    191 *
    192 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    193 *
    194 * This method should retrieve the glyph ID for a specified Unicode code point
    195 * followed by a specified Variation Selector code point. Glyph IDs must be
    196 * returned in a #hb_codepoint_t output parameter.
    197 * 
    198 * Return value: `true` if data found, `false` otherwise
    199 *
    200 **/
    201 typedef hb_bool_t (*hb_font_get_variation_glyph_func_t) (hb_font_t *font, void *font_data,
    202 						 hb_codepoint_t unicode, hb_codepoint_t variation_selector,
    203 						 hb_codepoint_t *glyph,
    204 						 void *user_data);
    205 
    206 
    207 /**
    208 * hb_font_get_nominal_glyphs_func_t:
    209 * @font: #hb_font_t to work upon
    210 * @font_data: @font user data pointer
    211 * @count: number of code points to query
    212 * @first_unicode: The first Unicode code point to query
    213 * @unicode_stride: The stride between successive code points
    214 * @first_glyph: (out): The first glyph ID retrieved
    215 * @glyph_stride: The stride between successive glyph IDs
    216 * @user_data: User data pointer passed by the caller
    217 *
    218 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    219 *
    220 * This method should retrieve the nominal glyph IDs for a sequence of
    221 * Unicode code points. Glyph IDs must be returned in a #hb_codepoint_t
    222 * output parameter.
    223 *
    224 * Return value: the number of code points processed
    225 * 
    226 **/
    227 typedef unsigned int (*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font, void *font_data,
    228 						   unsigned int count,
    229 						   const hb_codepoint_t *first_unicode,
    230 						   unsigned int unicode_stride,
    231 						   hb_codepoint_t *first_glyph,
    232 						   unsigned int glyph_stride,
    233 						   void *user_data);
    234 
    235 /**
    236 * hb_font_get_glyph_advance_func_t:
    237 * @font: #hb_font_t to work upon
    238 * @font_data: @font user data pointer
    239 * @glyph: The glyph ID to query
    240 * @user_data: User data pointer passed by the caller
    241 *
    242 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    243 *
    244 * This method should retrieve the advance for a specified glyph. The
    245 * method must return an #hb_position_t.
    246 * 
    247 * Return value: The advance of @glyph within @font
    248 *
    249 **/
    250 typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data,
    251 						   hb_codepoint_t glyph,
    252 						   void *user_data);
    253 
    254 /**
    255 * hb_font_get_glyph_h_advance_func_t:
    256 *
    257 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    258 *
    259 * This method should retrieve the advance for a specified glyph, in
    260 * horizontal-direction text segments. Advances must be returned in
    261 * an #hb_position_t output parameter.
    262 * 
    263 **/
    264 typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t;
    265 
    266 /**
    267 * hb_font_get_glyph_v_advance_func_t:
    268 *
    269 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    270 *
    271 * This method should retrieve the advance for a specified glyph, in
    272 * vertical-direction text segments. Advances must be returned in
    273 * an #hb_position_t output parameter.
    274 * 
    275 **/
    276 typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;
    277 
    278 /**
    279 * hb_font_get_glyph_advances_func_t:
    280 * @font: #hb_font_t to work upon
    281 * @font_data: @font user data pointer
    282 * @count: The number of glyph IDs in the sequence queried
    283 * @first_glyph: The first glyph ID to query
    284 * @glyph_stride: The stride between successive glyph IDs
    285 * @first_advance: (out): The first advance retrieved
    286 * @advance_stride: The stride between successive advances
    287 * @user_data: User data pointer passed by the caller
    288 *
    289 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    290 *
    291 * This method should retrieve the advances for a sequence of glyphs.
    292 * 
    293 **/
    294 typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_data,
    295 					   unsigned int count,
    296 					   const hb_codepoint_t *first_glyph,
    297 					   unsigned glyph_stride,
    298 					   hb_position_t *first_advance,
    299 					   unsigned advance_stride,
    300 					   void *user_data);
    301 
    302 /**
    303 * hb_font_get_glyph_h_advances_func_t:
    304 *
    305 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    306 *
    307 * This method should retrieve the advances for a sequence of glyphs, in
    308 * horizontal-direction text segments.
    309 * 
    310 **/
    311 typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_h_advances_func_t;
    312 
    313 /**
    314 * hb_font_get_glyph_v_advances_func_t:
    315 *
    316 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    317 *
    318 * This method should retrieve the advances for a sequence of glyphs, in
    319 * vertical-direction text segments.
    320 * 
    321 **/
    322 typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_v_advances_func_t;
    323 
    324 /**
    325 * hb_font_get_glyph_origin_func_t:
    326 * @font: #hb_font_t to work upon
    327 * @font_data: @font user data pointer
    328 * @glyph: The glyph ID to query
    329 * @x: (out): The X coordinate of the origin
    330 * @y: (out): The Y coordinate of the origin
    331 * @user_data: User data pointer passed by the caller
    332 *
    333 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    334 *
    335 * This method should retrieve the (X,Y) coordinates (in scaled units) of the
    336 * origin for a glyph. Each coordinate must be returned in an #hb_position_t
    337 * output parameter.
    338 *
    339 * Return value: `true` if data found, `false` otherwise
    340 * 
    341 **/
    342 typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *font_data,
    343 					      hb_codepoint_t glyph,
    344 					      hb_position_t *x, hb_position_t *y,
    345 					      void *user_data);
    346 
    347 /**
    348 * hb_font_get_glyph_h_origin_func_t:
    349 *
    350 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    351 *
    352 * This method should retrieve the (X,Y) coordinates (in scaled units) of the
    353 * origin for a glyph, for horizontal-direction text segments. Each
    354 * coordinate must be returned in an #hb_position_t output parameter.
    355 * 
    356 **/
    357 typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;
    358 
    359 /**
    360 * hb_font_get_glyph_v_origin_func_t:
    361 *
    362 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    363 *
    364 * This method should retrieve the (X,Y) coordinates (in scaled units) of the
    365 * origin for a glyph, for vertical-direction text segments. Each coordinate
    366 * must be returned in an #hb_position_t output parameter.
    367 * 
    368 **/
    369 typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t;
    370 
    371 /**
    372 * hb_font_get_glyph_origins_func_t:
    373 * @font: #hb_font_t to work upon
    374 * @font_data: @font user data pointer
    375 * @first_glyph: The first glyph ID to query
    376 * @count: number of glyphs to query
    377 * @glyph_stride: The stride between successive glyph IDs
    378 * @first_x: (out): The first origin X coordinate retrieved
    379 * @x_stride: The stride between successive origin X coordinates
    380 * @first_y: (out): The first origin Y coordinate retrieved
    381 * @y_stride: The stride between successive origin Y coordinates
    382 * @user_data: User data pointer passed by the caller
    383 *
    384 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    385 *
    386 * This method should retrieve the (X,Y) coordinates (in scaled units) of the
    387 * origin for each requested glyph. Each coordinate value must be returned in
    388 * an #hb_position_t in the two output parameters.
    389 *
    390 * Return value: `true` if data found, `false` otherwise
    391 *
    392 * Since: 11.3.0
    393 **/
    394 typedef hb_bool_t (*hb_font_get_glyph_origins_func_t) (hb_font_t *font, void *font_data,
    395 					       unsigned int count,
    396 					       const hb_codepoint_t *first_glyph,
    397 					       unsigned glyph_stride,
    398 					       hb_position_t *first_x,
    399 					       unsigned x_stride,
    400 					       hb_position_t *first_y,
    401 					       unsigned y_stride,
    402 					       void *user_data);
    403 
    404 /**
    405 * hb_font_get_glyph_h_origins_func_t:
    406 *
    407 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    408 *
    409 * This method should retrieve the (X,Y) coordinates (in scaled units) of the
    410 * origin for requested glyph, for horizontal-direction text segments. Each
    411 * coordinate must be returned in a the x/y #hb_position_t output parameters.
    412 *
    413 * Since: 11.3.0
    414 **/
    415 typedef hb_font_get_glyph_origins_func_t hb_font_get_glyph_h_origins_func_t;
    416 
    417 /**
    418 * hb_font_get_glyph_v_origins_func_t:
    419 *
    420 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    421 *
    422 * This method should retrieve the (X,Y) coordinates (in scaled units) of the
    423 * origin for requested glyph, for vertical-direction text segments. Each
    424 * coordinate must be returned in a the x/y #hb_position_t output parameters.
    425 *
    426 * Since: 11.3.0
    427 **/
    428 typedef hb_font_get_glyph_origins_func_t hb_font_get_glyph_v_origins_func_t;
    429 
    430 /**
    431 * hb_font_get_glyph_kerning_func_t:
    432 * @font: #hb_font_t to work upon
    433 * @font_data: @font user data pointer
    434 * @first_glyph: The glyph ID of the first glyph in the glyph pair
    435 * @second_glyph: The glyph ID of the second glyph in the glyph pair
    436 * @user_data: User data pointer passed by the caller
    437 *
    438 * This method should retrieve the kerning-adjustment value for a glyph-pair in
    439 * the specified font, for horizontal text segments.
    440 *
    441 **/
    442 typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data,
    443 						   hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
    444 						   void *user_data);
    445 /**
    446 * hb_font_get_glyph_h_kerning_func_t:
    447 *
    448 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    449 *
    450 * This method should retrieve the kerning-adjustment value for a glyph-pair in
    451 * the specified font, for horizontal text segments.
    452 *
    453 **/
    454 typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
    455 
    456 
    457 /**
    458 * hb_font_get_glyph_extents_func_t:
    459 * @font: #hb_font_t to work upon
    460 * @font_data: @font user data pointer
    461 * @glyph: The glyph ID to query
    462 * @extents: (out): The #hb_glyph_extents_t retrieved
    463 * @user_data: User data pointer passed by the caller
    464 *
    465 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    466 *
    467 * This method should retrieve the extents for a specified glyph. Extents must be 
    468 * returned in an #hb_glyph_extents output parameter.
    469 *
    470 * Return value: `true` if data found, `false` otherwise
    471 * 
    472 **/
    473 typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data,
    474 					       hb_codepoint_t glyph,
    475 					       hb_glyph_extents_t *extents,
    476 					       void *user_data);
    477 
    478 /**
    479 * hb_font_get_glyph_contour_point_func_t:
    480 * @font: #hb_font_t to work upon
    481 * @font_data: @font user data pointer
    482 * @glyph: The glyph ID to query
    483 * @point_index: The contour-point index to query
    484 * @x: (out): The X value retrieved for the contour point
    485 * @y: (out): The Y value retrieved for the contour point
    486 * @user_data: User data pointer passed by the caller
    487 *
    488 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    489 *
    490 * This method should retrieve the (X,Y) coordinates (in scaled units) for a
    491 * specified contour point in a glyph. Each coordinate must be returned as
    492 * an #hb_position_t output parameter.
    493 * 
    494 * Return value: `true` if data found, `false` otherwise
    495 *
    496 **/
    497 typedef hb_bool_t (*hb_font_get_glyph_contour_point_func_t) (hb_font_t *font, void *font_data,
    498 						     hb_codepoint_t glyph, unsigned int point_index,
    499 						     hb_position_t *x, hb_position_t *y,
    500 						     void *user_data);
    501 
    502 
    503 /**
    504 * hb_font_get_glyph_name_func_t:
    505 * @font: #hb_font_t to work upon
    506 * @font_data: @font user data pointer
    507 * @glyph: The glyph ID to query
    508 * @name: (out) (array length=size): Name string retrieved for the glyph ID
    509 * @size: Length of the glyph-name string retrieved
    510 * @user_data: User data pointer passed by the caller
    511 *
    512 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    513 *
    514 * This method should retrieve the glyph name that corresponds to a
    515 * glyph ID. The name should be returned in a string output parameter.
    516 * 
    517 * Return value: `true` if data found, `false` otherwise
    518 *
    519 **/
    520 typedef hb_bool_t (*hb_font_get_glyph_name_func_t) (hb_font_t *font, void *font_data,
    521 					    hb_codepoint_t glyph,
    522 					    char *name, unsigned int size,
    523 					    void *user_data);
    524 
    525 /**
    526 * hb_font_get_glyph_from_name_func_t:
    527 * @font: #hb_font_t to work upon
    528 * @font_data: @font user data pointer
    529 * @name: (array length=len): The name string to query
    530 * @len: The length of the name queried
    531 * @glyph: (out): The glyph ID retrieved
    532 * @user_data: User data pointer passed by the caller
    533 *
    534 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    535 *
    536 * This method should retrieve the glyph ID that corresponds to a glyph-name
    537 * string. 
    538 * 
    539 * Return value: `true` if data found, `false` otherwise
    540 *
    541 **/
    542 typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *font_data,
    543 						 const char *name, int len, /* -1 means nul-terminated */
    544 						 hb_codepoint_t *glyph,
    545 						 void *user_data);
    546 
    547 /**
    548 * hb_font_draw_glyph_or_fail_func_t:
    549 * @font: #hb_font_t to work upon
    550 * @font_data: @font user data pointer
    551 * @glyph: The glyph ID to query
    552 * @draw_funcs: The draw functions to send the shape data to
    553 * @draw_data: The data accompanying the draw functions
    554 * @user_data: User data pointer passed by the caller
    555 *
    556 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    557 *
    558 * Return value: `true` if glyph was drawn, `false` otherwise
    559 *
    560 * Since: 11.2.0
    561 **/
    562 typedef hb_bool_t (*hb_font_draw_glyph_or_fail_func_t) (hb_font_t *font, void *font_data,
    563 						hb_codepoint_t glyph,
    564 						hb_draw_funcs_t *draw_funcs, void *draw_data,
    565 						void *user_data);
    566 
    567 /**
    568 * hb_font_paint_glyph_or_fail_func_t:
    569 * @font: #hb_font_t to work upon
    570 * @font_data: @font user data pointer
    571 * @glyph: The glyph ID to query
    572 * @paint_funcs: The paint functions to use
    573 * @paint_data: The data accompanying the paint functions
    574 * @palette_index: The color palette to use
    575 * @foreground: The foreground color
    576 * @user_data: User data pointer passed by the caller
    577 *
    578 * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
    579 *
    580 * Return value: `true` if glyph was painted, `false` otherwise
    581 *
    582 * Since: 11.2.0
    583 */
    584 typedef hb_bool_t (*hb_font_paint_glyph_or_fail_func_t) (hb_font_t *font, void *font_data,
    585 						 hb_codepoint_t glyph,
    586 						 hb_paint_funcs_t *paint_funcs, void *paint_data,
    587 						 unsigned int palette_index,
    588 						 hb_color_t foreground,
    589 						 void *user_data);
    590 
    591 /* func setters */
    592 
    593 /**
    594 * hb_font_funcs_set_font_h_extents_func:
    595 * @ffuncs: A font-function structure
    596 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    597 * @user_data: Data to pass to @func
    598 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    599 *
    600 * Sets the implementation function for #hb_font_get_font_h_extents_func_t.
    601 *
    602 * Since: 1.1.2
    603 **/
    604 HB_EXTERN void
    605 hb_font_funcs_set_font_h_extents_func (hb_font_funcs_t *ffuncs,
    606 			       hb_font_get_font_h_extents_func_t func,
    607 			       void *user_data, hb_destroy_func_t destroy);
    608 
    609 /**
    610 * hb_font_funcs_set_font_v_extents_func:
    611 * @ffuncs: A font-function structure
    612 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    613 * @user_data: Data to pass to @func
    614 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    615 *
    616 * Sets the implementation function for #hb_font_get_font_v_extents_func_t.
    617 *
    618 * Since: 1.1.2
    619 **/
    620 HB_EXTERN void
    621 hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs,
    622 			       hb_font_get_font_v_extents_func_t func,
    623 			       void *user_data, hb_destroy_func_t destroy);
    624 
    625 /**
    626 * hb_font_funcs_set_nominal_glyph_func:
    627 * @ffuncs: A font-function structure
    628 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    629 * @user_data: Data to pass to @func
    630 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    631 *
    632 * Sets the implementation function for #hb_font_get_nominal_glyph_func_t.
    633 *
    634 * Since: 1.2.3
    635 **/
    636 HB_EXTERN void
    637 hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs,
    638 			      hb_font_get_nominal_glyph_func_t func,
    639 			      void *user_data, hb_destroy_func_t destroy);
    640 
    641 /**
    642 * hb_font_funcs_set_nominal_glyphs_func:
    643 * @ffuncs: A font-function structure
    644 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    645 * @user_data: Data to pass to @func
    646 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    647 *
    648 * Sets the implementation function for #hb_font_get_nominal_glyphs_func_t.
    649 *
    650 * Since: 2.0.0
    651 **/
    652 HB_EXTERN void
    653 hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs,
    654 			       hb_font_get_nominal_glyphs_func_t func,
    655 			       void *user_data, hb_destroy_func_t destroy);
    656 
    657 /**
    658 * hb_font_funcs_set_variation_glyph_func:
    659 * @ffuncs: A font-function structure
    660 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    661 * @user_data: Data to pass to @func
    662 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    663 *
    664 * Sets the implementation function for #hb_font_get_variation_glyph_func_t.
    665 *
    666 * Since: 1.2.3
    667 **/
    668 HB_EXTERN void
    669 hb_font_funcs_set_variation_glyph_func (hb_font_funcs_t *ffuncs,
    670 				hb_font_get_variation_glyph_func_t func,
    671 				void *user_data, hb_destroy_func_t destroy);
    672 
    673 /**
    674 * hb_font_funcs_set_glyph_h_advance_func:
    675 * @ffuncs: A font-function structure
    676 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    677 * @user_data: Data to pass to @func
    678 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    679 *
    680 * Sets the implementation function for #hb_font_get_glyph_h_advance_func_t.
    681 *
    682 * Since: 0.9.2
    683 **/
    684 HB_EXTERN void
    685 hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
    686 				hb_font_get_glyph_h_advance_func_t func,
    687 				void *user_data, hb_destroy_func_t destroy);
    688 
    689 /**
    690 * hb_font_funcs_set_glyph_v_advance_func:
    691 * @ffuncs: A font-function structure
    692 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    693 * @user_data: Data to pass to @func
    694 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    695 *
    696 * Sets the implementation function for #hb_font_get_glyph_v_advance_func_t.
    697 *
    698 * Since: 0.9.2
    699 **/
    700 HB_EXTERN void
    701 hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
    702 				hb_font_get_glyph_v_advance_func_t func,
    703 				void *user_data, hb_destroy_func_t destroy);
    704 
    705 /**
    706 * hb_font_funcs_set_glyph_h_advances_func:
    707 * @ffuncs: A font-function structure
    708 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    709 * @user_data: Data to pass to @func
    710 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    711 *
    712 * Sets the implementation function for #hb_font_get_glyph_h_advances_func_t.
    713 *
    714 * Since: 1.8.6
    715 **/
    716 HB_EXTERN void
    717 hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
    718 				hb_font_get_glyph_h_advances_func_t func,
    719 				void *user_data, hb_destroy_func_t destroy);
    720 
    721 /**
    722 * hb_font_funcs_set_glyph_v_advances_func:
    723 * @ffuncs: A font-function structure
    724 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    725 * @user_data: Data to pass to @func
    726 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    727 *
    728 * Sets the implementation function for #hb_font_get_glyph_v_advances_func_t.
    729 *
    730 * Since: 1.8.6
    731 **/
    732 HB_EXTERN void
    733 hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
    734 				hb_font_get_glyph_v_advances_func_t func,
    735 				void *user_data, hb_destroy_func_t destroy);
    736 
    737 /**
    738 * hb_font_funcs_set_glyph_h_origin_func:
    739 * @ffuncs: A font-function structure
    740 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    741 * @user_data: Data to pass to @func
    742 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    743 *
    744 * Sets the implementation function for #hb_font_get_glyph_h_origin_func_t.
    745 *
    746 * Since: 0.9.2
    747 **/
    748 HB_EXTERN void
    749 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
    750 			       hb_font_get_glyph_h_origin_func_t func,
    751 			       void *user_data, hb_destroy_func_t destroy);
    752 
    753 /**
    754 * hb_font_funcs_set_glyph_v_origin_func:
    755 * @ffuncs: A font-function structure
    756 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    757 * @user_data: Data to pass to @func
    758 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    759 *
    760 * Sets the implementation function for #hb_font_get_glyph_v_origin_func_t.
    761 *
    762 * Since: 0.9.2
    763 **/
    764 HB_EXTERN void
    765 hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
    766 			       hb_font_get_glyph_v_origin_func_t func,
    767 			       void *user_data, hb_destroy_func_t destroy);
    768 
    769 /**
    770 * hb_font_funcs_set_glyph_h_origins_func:
    771 * @ffuncs: A font-function structure
    772 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    773 * @user_data: Data to pass to @func
    774 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    775 *
    776 * Sets the implementation function for #hb_font_get_glyph_h_origins_func_t.
    777 *
    778 * Since: 11.3.0
    779 **/
    780 HB_EXTERN void
    781 hb_font_funcs_set_glyph_h_origins_func (hb_font_funcs_t *ffuncs,
    782 				hb_font_get_glyph_h_origins_func_t func,
    783 				void *user_data, hb_destroy_func_t destroy);
    784 
    785 /**
    786 * hb_font_funcs_set_glyph_v_origins_func:
    787 * @ffuncs: A font-function structure
    788 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    789 * @user_data: Data to pass to @func
    790 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    791 *
    792 * Sets the implementation function for #hb_font_get_glyph_v_origins_func_t.
    793 *
    794 * Since: 11.3.0
    795 **/
    796 HB_EXTERN void
    797 hb_font_funcs_set_glyph_v_origins_func (hb_font_funcs_t *ffuncs,
    798 				hb_font_get_glyph_v_origins_func_t func,
    799 				void *user_data, hb_destroy_func_t destroy);
    800 
    801 /**
    802 * hb_font_funcs_set_glyph_h_kerning_func:
    803 * @ffuncs: A font-function structure
    804 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    805 * @user_data: Data to pass to @func
    806 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    807 *
    808 * Sets the implementation function for #hb_font_get_glyph_h_kerning_func_t.
    809 *
    810 * Since: 0.9.2
    811 **/
    812 HB_EXTERN void
    813 hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
    814 				hb_font_get_glyph_h_kerning_func_t func,
    815 				void *user_data, hb_destroy_func_t destroy);
    816 
    817 /**
    818 * hb_font_funcs_set_glyph_extents_func:
    819 * @ffuncs: A font-function structure
    820 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    821 * @user_data: Data to pass to @func
    822 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    823 *
    824 * Sets the implementation function for #hb_font_get_glyph_extents_func_t.
    825 *
    826 * Since: 0.9.2
    827 **/
    828 HB_EXTERN void
    829 hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
    830 			      hb_font_get_glyph_extents_func_t func,
    831 			      void *user_data, hb_destroy_func_t destroy);
    832 
    833 /**
    834 * hb_font_funcs_set_glyph_contour_point_func:
    835 * @ffuncs: A font-function structure
    836 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    837 * @user_data: Data to pass to @func
    838 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    839 *
    840 * Sets the implementation function for #hb_font_get_glyph_contour_point_func_t.
    841 *
    842 * Since: 0.9.2
    843 **/
    844 HB_EXTERN void
    845 hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
    846 				    hb_font_get_glyph_contour_point_func_t func,
    847 				    void *user_data, hb_destroy_func_t destroy);
    848 
    849 /**
    850 * hb_font_funcs_set_glyph_name_func:
    851 * @ffuncs: A font-function structure
    852 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    853 * @user_data: Data to pass to @func
    854 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    855 *
    856 * Sets the implementation function for #hb_font_get_glyph_name_func_t.
    857 *
    858 * Since: 0.9.2
    859 **/
    860 HB_EXTERN void
    861 hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
    862 			   hb_font_get_glyph_name_func_t func,
    863 			   void *user_data, hb_destroy_func_t destroy);
    864 
    865 /**
    866 * hb_font_funcs_set_glyph_from_name_func:
    867 * @ffuncs: A font-function structure
    868 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    869 * @user_data: Data to pass to @func
    870 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    871 *
    872 * Sets the implementation function for #hb_font_get_glyph_from_name_func_t.
    873 *
    874 * Since: 0.9.2
    875 **/
    876 HB_EXTERN void
    877 hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs,
    878 				hb_font_get_glyph_from_name_func_t func,
    879 				void *user_data, hb_destroy_func_t destroy);
    880 
    881 /**
    882 * hb_font_funcs_set_draw_glyph_or_fail_func:
    883 * @ffuncs: A font-function structure
    884 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    885 * @user_data: Data to pass to @func
    886 * @destroy: (nullable): The function to call when @user_data is not needed anymore
    887 *
    888 * Sets the implementation function for #hb_font_draw_glyph_or_fail_func_t.
    889 *
    890 * Since: 11.2.0
    891 **/
    892 HB_EXTERN void
    893 hb_font_funcs_set_draw_glyph_or_fail_func (hb_font_funcs_t *ffuncs,
    894 				   hb_font_draw_glyph_or_fail_func_t func,
    895 				   void *user_data, hb_destroy_func_t destroy);
    896 
    897 /**
    898 * hb_font_funcs_set_paint_glyph_or_fail_func:
    899 * @ffuncs: A font-function structure
    900 * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
    901 * @user_data: Data to pass to @func
    902 * @destroy: (nullable): The function to call when @user_data is no longer needed
    903 *
    904 * Sets the implementation function for #hb_font_paint_glyph_or_fail_func_t.
    905 *
    906 * Since: 11.2.0
    907 */
    908 HB_EXTERN void
    909 hb_font_funcs_set_paint_glyph_or_fail_func (hb_font_funcs_t *ffuncs,
    910 				    hb_font_paint_glyph_or_fail_func_t func,
    911 				    void *user_data, hb_destroy_func_t destroy);
    912 
    913 /* func dispatch */
    914 
    915 HB_EXTERN hb_bool_t
    916 hb_font_get_h_extents (hb_font_t *font,
    917 	       hb_font_extents_t *extents);
    918 HB_EXTERN hb_bool_t
    919 hb_font_get_v_extents (hb_font_t *font,
    920 	       hb_font_extents_t *extents);
    921 
    922 HB_EXTERN hb_bool_t
    923 hb_font_get_nominal_glyph (hb_font_t *font,
    924 		   hb_codepoint_t unicode,
    925 		   hb_codepoint_t *glyph);
    926 HB_EXTERN hb_bool_t
    927 hb_font_get_variation_glyph (hb_font_t *font,
    928 		     hb_codepoint_t unicode, hb_codepoint_t variation_selector,
    929 		     hb_codepoint_t *glyph);
    930 
    931 HB_EXTERN unsigned int
    932 hb_font_get_nominal_glyphs (hb_font_t *font,
    933 		    unsigned int count,
    934 		    const hb_codepoint_t *first_unicode,
    935 		    unsigned int unicode_stride,
    936 		    hb_codepoint_t *first_glyph,
    937 		    unsigned int glyph_stride);
    938 
    939 HB_EXTERN hb_position_t
    940 hb_font_get_glyph_h_advance (hb_font_t *font,
    941 		     hb_codepoint_t glyph);
    942 HB_EXTERN hb_position_t
    943 hb_font_get_glyph_v_advance (hb_font_t *font,
    944 		     hb_codepoint_t glyph);
    945 
    946 HB_EXTERN void
    947 hb_font_get_glyph_h_advances (hb_font_t* font,
    948 		      unsigned int count,
    949 		      const hb_codepoint_t *first_glyph,
    950 		      unsigned glyph_stride,
    951 		      hb_position_t *first_advance,
    952 		      unsigned advance_stride);
    953 HB_EXTERN void
    954 hb_font_get_glyph_v_advances (hb_font_t* font,
    955 		      unsigned int count,
    956 		      const hb_codepoint_t *first_glyph,
    957 		      unsigned glyph_stride,
    958 		      hb_position_t *first_advance,
    959 		      unsigned advance_stride);
    960 
    961 HB_EXTERN hb_bool_t
    962 hb_font_get_glyph_h_origin (hb_font_t *font,
    963 		    hb_codepoint_t glyph,
    964 		    hb_position_t *x, hb_position_t *y);
    965 HB_EXTERN hb_bool_t
    966 hb_font_get_glyph_v_origin (hb_font_t *font,
    967 		    hb_codepoint_t glyph,
    968 		    hb_position_t *x, hb_position_t *y);
    969 
    970 HB_EXTERN hb_bool_t
    971 hb_font_get_glyph_h_origins (hb_font_t *font,
    972 		     unsigned int count,
    973 		     const hb_codepoint_t *first_glyph,
    974 		     unsigned glyph_stride,
    975 		     hb_position_t *first_x,
    976 		     unsigned x_stride,
    977 		     hb_position_t *first_y,
    978 		     unsigned y_stride);
    979 
    980 HB_EXTERN hb_bool_t
    981 hb_font_get_glyph_v_origins (hb_font_t *font,
    982 		     unsigned int count,
    983 		     const hb_codepoint_t *first_glyph,
    984 		     unsigned glyph_stride,
    985 		     hb_position_t *first_x,
    986 		     unsigned x_stride,
    987 		     hb_position_t *first_y,
    988 		     unsigned y_stride);
    989 
    990 HB_EXTERN hb_position_t
    991 hb_font_get_glyph_h_kerning (hb_font_t *font,
    992 		     hb_codepoint_t left_glyph, hb_codepoint_t right_glyph);
    993 
    994 HB_EXTERN hb_bool_t
    995 hb_font_get_glyph_extents (hb_font_t *font,
    996 		   hb_codepoint_t glyph,
    997 		   hb_glyph_extents_t *extents);
    998 
    999 HB_EXTERN hb_bool_t
   1000 hb_font_get_glyph_contour_point (hb_font_t *font,
   1001 			 hb_codepoint_t glyph, unsigned int point_index,
   1002 			 hb_position_t *x, hb_position_t *y);
   1003 
   1004 HB_EXTERN hb_bool_t
   1005 hb_font_get_glyph_name (hb_font_t *font,
   1006 		hb_codepoint_t glyph,
   1007 		char *name, unsigned int size);
   1008 HB_EXTERN hb_bool_t
   1009 hb_font_get_glyph_from_name (hb_font_t *font,
   1010 		     const char *name, int len, /* -1 means nul-terminated */
   1011 		     hb_codepoint_t *glyph);
   1012 
   1013 HB_EXTERN hb_bool_t
   1014 hb_font_draw_glyph_or_fail (hb_font_t *font,
   1015 		    hb_codepoint_t glyph,
   1016 		    hb_draw_funcs_t *dfuncs, void *draw_data);
   1017 
   1018 HB_EXTERN hb_bool_t
   1019 hb_font_paint_glyph_or_fail (hb_font_t *font,
   1020 		     hb_codepoint_t glyph,
   1021 		     hb_paint_funcs_t *pfuncs, void *paint_data,
   1022 		     unsigned int palette_index,
   1023 		     hb_color_t foreground);
   1024 
   1025 /* high-level funcs, with fallback */
   1026 
   1027 /* Calls either hb_font_get_nominal_glyph() if variation_selector is 0,
   1028 * otherwise calls hb_font_get_variation_glyph(). */
   1029 HB_EXTERN hb_bool_t
   1030 hb_font_get_glyph (hb_font_t *font,
   1031 	   hb_codepoint_t unicode, hb_codepoint_t variation_selector,
   1032 	   hb_codepoint_t *glyph);
   1033 
   1034 HB_EXTERN void
   1035 hb_font_get_extents_for_direction (hb_font_t *font,
   1036 			   hb_direction_t direction,
   1037 			   hb_font_extents_t *extents);
   1038 HB_EXTERN void
   1039 hb_font_get_glyph_advance_for_direction (hb_font_t *font,
   1040 				 hb_codepoint_t glyph,
   1041 				 hb_direction_t direction,
   1042 				 hb_position_t *x, hb_position_t *y);
   1043 HB_EXTERN void
   1044 hb_font_get_glyph_advances_for_direction (hb_font_t* font,
   1045 				  hb_direction_t direction,
   1046 				  unsigned int count,
   1047 				  const hb_codepoint_t *first_glyph,
   1048 				  unsigned glyph_stride,
   1049 				  hb_position_t *first_advance,
   1050 				  unsigned advance_stride);
   1051 HB_EXTERN void
   1052 hb_font_get_glyph_origin_for_direction (hb_font_t *font,
   1053 				hb_codepoint_t glyph,
   1054 				hb_direction_t direction,
   1055 				hb_position_t *x, hb_position_t *y);
   1056 HB_EXTERN void
   1057 hb_font_add_glyph_origin_for_direction (hb_font_t *font,
   1058 				hb_codepoint_t glyph,
   1059 				hb_direction_t direction,
   1060 				hb_position_t *x, hb_position_t *y);
   1061 HB_EXTERN void
   1062 hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
   1063 				     hb_codepoint_t glyph,
   1064 				     hb_direction_t direction,
   1065 				     hb_position_t *x, hb_position_t *y);
   1066 
   1067 HB_EXTERN void
   1068 hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
   1069 				 hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
   1070 				 hb_direction_t direction,
   1071 				 hb_position_t *x, hb_position_t *y);
   1072 
   1073 HB_EXTERN hb_bool_t
   1074 hb_font_get_glyph_extents_for_origin (hb_font_t *font,
   1075 			      hb_codepoint_t glyph,
   1076 			      hb_direction_t direction,
   1077 			      hb_glyph_extents_t *extents);
   1078 
   1079 HB_EXTERN hb_bool_t
   1080 hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
   1081 				    hb_codepoint_t glyph, unsigned int point_index,
   1082 				    hb_direction_t direction,
   1083 				    hb_position_t *x, hb_position_t *y);
   1084 
   1085 /* Generates gidDDD if glyph has no name. */
   1086 HB_EXTERN void
   1087 hb_font_glyph_to_string (hb_font_t *font,
   1088 		 hb_codepoint_t glyph,
   1089 		 char *s, unsigned int size);
   1090 /* Parses gidDDD and uniUUUU strings automatically. */
   1091 HB_EXTERN hb_bool_t
   1092 hb_font_glyph_from_string (hb_font_t *font,
   1093 		   const char *s, int len, /* -1 means nul-terminated */
   1094 		   hb_codepoint_t *glyph);
   1095 
   1096 /* Older alias for hb_font_draw_glyph_or_fail() with no return value. */
   1097 HB_EXTERN void
   1098 hb_font_draw_glyph (hb_font_t *font,
   1099 	    hb_codepoint_t glyph,
   1100 	    hb_draw_funcs_t *dfuncs, void *draw_data);
   1101 
   1102 /* Paints color glyph; if failed, draws outline glyph. */
   1103 HB_EXTERN void
   1104 hb_font_paint_glyph (hb_font_t *font,
   1105 	     hb_codepoint_t glyph,
   1106 	     hb_paint_funcs_t *pfuncs, void *paint_data,
   1107 	     unsigned int palette_index,
   1108 	     hb_color_t foreground);
   1109 
   1110 /*
   1111 * hb_font_t
   1112 */
   1113 
   1114 /* Fonts are very light-weight objects */
   1115 
   1116 HB_EXTERN hb_font_t *
   1117 hb_font_create (hb_face_t *face);
   1118 
   1119 HB_EXTERN hb_font_t *
   1120 hb_font_create_sub_font (hb_font_t *parent);
   1121 
   1122 HB_EXTERN hb_font_t *
   1123 hb_font_get_empty (void);
   1124 
   1125 HB_EXTERN hb_font_t *
   1126 hb_font_reference (hb_font_t *font);
   1127 
   1128 HB_EXTERN void
   1129 hb_font_destroy (hb_font_t *font);
   1130 
   1131 HB_EXTERN hb_bool_t
   1132 hb_font_set_user_data (hb_font_t          *font,
   1133 	       hb_user_data_key_t *key,
   1134 	       void *              data,
   1135 	       hb_destroy_func_t   destroy,
   1136 	       hb_bool_t           replace);
   1137 
   1138 
   1139 HB_EXTERN void *
   1140 hb_font_get_user_data (const hb_font_t    *font,
   1141 	       hb_user_data_key_t *key);
   1142 
   1143 HB_EXTERN void
   1144 hb_font_make_immutable (hb_font_t *font);
   1145 
   1146 HB_EXTERN hb_bool_t
   1147 hb_font_is_immutable (hb_font_t *font);
   1148 
   1149 HB_EXTERN unsigned int
   1150 hb_font_get_serial (hb_font_t *font);
   1151 
   1152 HB_EXTERN void
   1153 hb_font_changed (hb_font_t *font);
   1154 
   1155 HB_EXTERN void
   1156 hb_font_set_parent (hb_font_t *font,
   1157 	    hb_font_t *parent);
   1158 
   1159 HB_EXTERN hb_font_t *
   1160 hb_font_get_parent (hb_font_t *font);
   1161 
   1162 HB_EXTERN void
   1163 hb_font_set_face (hb_font_t *font,
   1164 	  hb_face_t *face);
   1165 
   1166 HB_EXTERN hb_face_t *
   1167 hb_font_get_face (hb_font_t *font);
   1168 
   1169 
   1170 HB_EXTERN void
   1171 hb_font_set_funcs (hb_font_t         *font,
   1172 	   hb_font_funcs_t   *klass,
   1173 	   void              *font_data,
   1174 	   hb_destroy_func_t  destroy);
   1175 
   1176 /* Be *very* careful with this function! */
   1177 HB_EXTERN void
   1178 hb_font_set_funcs_data (hb_font_t         *font,
   1179 		void              *font_data,
   1180 		hb_destroy_func_t  destroy);
   1181 
   1182 HB_EXTERN hb_bool_t
   1183 hb_font_set_funcs_using (hb_font_t  *font,
   1184 		 const char *name);
   1185 
   1186 HB_EXTERN const char **
   1187 hb_font_list_funcs (void);
   1188 
   1189 HB_EXTERN void
   1190 hb_font_set_scale (hb_font_t *font,
   1191 	   int x_scale,
   1192 	   int y_scale);
   1193 
   1194 HB_EXTERN void
   1195 hb_font_get_scale (hb_font_t *font,
   1196 	   int *x_scale,
   1197 	   int *y_scale);
   1198 
   1199 /*
   1200 * A zero value means "no hinting in that direction"
   1201 */
   1202 HB_EXTERN void
   1203 hb_font_set_ppem (hb_font_t *font,
   1204 	  unsigned int x_ppem,
   1205 	  unsigned int y_ppem);
   1206 
   1207 HB_EXTERN void
   1208 hb_font_get_ppem (hb_font_t *font,
   1209 	  unsigned int *x_ppem,
   1210 	  unsigned int *y_ppem);
   1211 
   1212 /*
   1213 * Point size per EM.  Used for optical-sizing in CoreText.
   1214 * A value of zero means "not set".
   1215 */
   1216 HB_EXTERN void
   1217 hb_font_set_ptem (hb_font_t *font, float ptem);
   1218 
   1219 HB_EXTERN float
   1220 hb_font_get_ptem (hb_font_t *font);
   1221 
   1222 HB_EXTERN hb_bool_t
   1223 hb_font_is_synthetic (hb_font_t *font);
   1224 
   1225 HB_EXTERN void
   1226 hb_font_set_synthetic_bold (hb_font_t *font,
   1227 		    float x_embolden, float y_embolden,
   1228 		    hb_bool_t in_place);
   1229 
   1230 HB_EXTERN void
   1231 hb_font_get_synthetic_bold (hb_font_t *font,
   1232 		    float *x_embolden, float *y_embolden,
   1233 		    hb_bool_t *in_place);
   1234 
   1235 HB_EXTERN void
   1236 hb_font_set_synthetic_slant (hb_font_t *font, float slant);
   1237 
   1238 HB_EXTERN float
   1239 hb_font_get_synthetic_slant (hb_font_t *font);
   1240 
   1241 HB_EXTERN void
   1242 hb_font_set_variations (hb_font_t *font,
   1243 		const hb_variation_t *variations,
   1244 		unsigned int variations_length);
   1245 
   1246 HB_EXTERN void
   1247 hb_font_set_variation (hb_font_t *font,
   1248 	       hb_tag_t tag,
   1249 	       float    value);
   1250 
   1251 HB_EXTERN void
   1252 hb_font_set_var_coords_design (hb_font_t *font,
   1253 		       const float *coords,
   1254 		       unsigned int coords_length);
   1255 
   1256 HB_EXTERN const float *
   1257 hb_font_get_var_coords_design (hb_font_t *font,
   1258 		       unsigned int *length);
   1259 
   1260 HB_EXTERN void
   1261 hb_font_set_var_coords_normalized (hb_font_t *font,
   1262 			   const int *coords, /* 2.14 normalized */
   1263 			   unsigned int coords_length);
   1264 
   1265 HB_EXTERN const int *
   1266 hb_font_get_var_coords_normalized (hb_font_t *font,
   1267 			   unsigned int *length);
   1268 
   1269 /**
   1270 * HB_FONT_NO_VAR_NAMED_INSTANCE:
   1271 *
   1272 * Constant signifying that a font does not have any
   1273 * named-instance index set.  This is the default of
   1274 * a font.
   1275 *
   1276 * Since: 7.0.0
   1277 */
   1278 #define HB_FONT_NO_VAR_NAMED_INSTANCE 0xFFFFFFFF
   1279 
   1280 HB_EXTERN void
   1281 hb_font_set_var_named_instance (hb_font_t *font,
   1282 			unsigned int instance_index);
   1283 
   1284 HB_EXTERN unsigned int
   1285 hb_font_get_var_named_instance (hb_font_t *font);
   1286 
   1287 HB_END_DECLS
   1288 
   1289 #endif /* HB_FONT_H */