Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-31 08:22:18

0001 /*
0002  * Copyright © 2009  Red Hat, Inc.
0003  *
0004  *  This is part of HarfBuzz, a text shaping library.
0005  *
0006  * Permission is hereby granted, without written agreement and without
0007  * license or royalty fees, to use, copy, modify, and distribute this
0008  * software and its documentation for any purpose, provided that the
0009  * above copyright notice and the following two paragraphs appear in
0010  * all copies of this software.
0011  *
0012  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
0013  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
0014  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
0015  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
0016  * DAMAGE.
0017  *
0018  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
0019  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
0020  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
0021  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
0022  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
0023  *
0024  * Red Hat Author(s): Behdad Esfahbod
0025  */
0026 
0027 #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
0028 #error "Include <hb.h> instead."
0029 #endif
0030 
0031 #ifndef HB_FONT_H
0032 #define HB_FONT_H
0033 
0034 #include "hb-common.h"
0035 #include "hb-face.h"
0036 #include "hb-draw.h"
0037 #include "hb-paint.h"
0038 
0039 HB_BEGIN_DECLS
0040 
0041 /*
0042  * hb_font_funcs_t
0043  */
0044 
0045 /**
0046  * hb_font_funcs_t:
0047  *
0048  * Data type containing a set of virtual methods used for
0049  * working on #hb_font_t font objects.
0050  *
0051  * HarfBuzz provides a lightweight default function for each of 
0052  * the methods in #hb_font_funcs_t. Client programs can implement
0053  * their own replacements for the individual font functions, as
0054  * needed, and replace the default by calling the setter for a
0055  * method.
0056  *
0057  **/
0058 typedef struct hb_font_funcs_t hb_font_funcs_t;
0059 
0060 HB_EXTERN hb_font_funcs_t *
0061 hb_font_funcs_create (void);
0062 
0063 HB_EXTERN hb_font_funcs_t *
0064 hb_font_funcs_get_empty (void);
0065 
0066 HB_EXTERN hb_font_funcs_t *
0067 hb_font_funcs_reference (hb_font_funcs_t *ffuncs);
0068 
0069 HB_EXTERN void
0070 hb_font_funcs_destroy (hb_font_funcs_t *ffuncs);
0071 
0072 HB_EXTERN hb_bool_t
0073 hb_font_funcs_set_user_data (hb_font_funcs_t    *ffuncs,
0074                  hb_user_data_key_t *key,
0075                  void *              data,
0076                  hb_destroy_func_t   destroy,
0077                  hb_bool_t           replace);
0078 
0079 
0080 HB_EXTERN void *
0081 hb_font_funcs_get_user_data (const hb_font_funcs_t *ffuncs,
0082                  hb_user_data_key_t    *key);
0083 
0084 
0085 HB_EXTERN void
0086 hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);
0087 
0088 HB_EXTERN hb_bool_t
0089 hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs);
0090 
0091 
0092 /* font extents */
0093 
0094 /**
0095  * hb_font_extents_t:
0096  * @ascender: The height of typographic ascenders.
0097  * @descender: The depth of typographic descenders.
0098  * @line_gap: The suggested line-spacing gap.
0099  *
0100  * Font-wide extent values, measured in scaled units.
0101  *
0102  * Note that typically @ascender is positive and @descender
0103  * negative, in coordinate systems that grow up.
0104  **/
0105 typedef struct hb_font_extents_t {
0106   hb_position_t ascender;
0107   hb_position_t descender;
0108   hb_position_t line_gap;
0109   /*< private >*/
0110   hb_position_t reserved9;
0111   hb_position_t reserved8;
0112   hb_position_t reserved7;
0113   hb_position_t reserved6;
0114   hb_position_t reserved5;
0115   hb_position_t reserved4;
0116   hb_position_t reserved3;
0117   hb_position_t reserved2;
0118   hb_position_t reserved1;
0119 } hb_font_extents_t;
0120 
0121 /* func types */
0122 
0123 /**
0124  * hb_font_get_font_extents_func_t:
0125  * @font: #hb_font_t to work upon
0126  * @font_data: @font user data pointer
0127  * @extents: (out): The font extents retrieved
0128  * @user_data: User data pointer passed by the caller
0129  *
0130  * This method should retrieve the extents for a font.
0131  *
0132  **/
0133 typedef hb_bool_t (*hb_font_get_font_extents_func_t) (hb_font_t *font, void *font_data,
0134                                hb_font_extents_t *extents,
0135                                void *user_data);
0136 
0137 /**
0138  * hb_font_get_font_h_extents_func_t:
0139  *
0140  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0141  *
0142  * This method should retrieve the extents for a font, for horizontal-direction
0143  * text segments. Extents must be returned in an #hb_glyph_extents output
0144  * parameter.
0145  * 
0146  **/
0147 typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t;
0148 
0149 /**
0150  * hb_font_get_font_v_extents_func_t:
0151  *
0152  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0153  *
0154  * This method should retrieve the extents for a font, for vertical-direction
0155  * text segments. Extents must be returned in an #hb_glyph_extents output
0156  * parameter.
0157  * 
0158  **/
0159 typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t;
0160 
0161 
0162 /**
0163  * hb_font_get_nominal_glyph_func_t:
0164  * @font: #hb_font_t to work upon
0165  * @font_data: @font user data pointer
0166  * @unicode: The Unicode code point to query
0167  * @glyph: (out): The glyph ID retrieved
0168  * @user_data: User data pointer passed by the caller
0169  *
0170  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0171  *
0172  * This method should retrieve the nominal glyph ID for a specified Unicode code
0173  * point. Glyph IDs must be returned in a #hb_codepoint_t output parameter.
0174  * 
0175  * Return value: `true` if data found, `false` otherwise
0176  *
0177  **/
0178 typedef hb_bool_t (*hb_font_get_nominal_glyph_func_t) (hb_font_t *font, void *font_data,
0179                                hb_codepoint_t unicode,
0180                                hb_codepoint_t *glyph,
0181                                void *user_data);
0182 
0183 /**
0184  * hb_font_get_variation_glyph_func_t:
0185  * @font: #hb_font_t to work upon
0186  * @font_data: @font user data pointer
0187  * @unicode: The Unicode code point to query
0188  * @variation_selector: The  variation-selector code point to query
0189  * @glyph: (out): The glyph ID retrieved
0190  * @user_data: User data pointer passed by the caller
0191  *
0192  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0193  *
0194  * This method should retrieve the glyph ID for a specified Unicode code point
0195  * followed by a specified Variation Selector code point. Glyph IDs must be
0196  * returned in a #hb_codepoint_t output parameter.
0197  * 
0198  * Return value: `true` if data found, `false` otherwise
0199  *
0200  **/
0201 typedef hb_bool_t (*hb_font_get_variation_glyph_func_t) (hb_font_t *font, void *font_data,
0202                              hb_codepoint_t unicode, hb_codepoint_t variation_selector,
0203                              hb_codepoint_t *glyph,
0204                              void *user_data);
0205 
0206 
0207 /**
0208  * hb_font_get_nominal_glyphs_func_t:
0209  * @font: #hb_font_t to work upon
0210  * @font_data: @font user data pointer
0211  * @count: number of code points to query
0212  * @first_unicode: The first Unicode code point to query
0213  * @unicode_stride: The stride between successive code points
0214  * @first_glyph: (out): The first glyph ID retrieved
0215  * @glyph_stride: The stride between successive glyph IDs
0216  * @user_data: User data pointer passed by the caller
0217  *
0218  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0219  *
0220  * This method should retrieve the nominal glyph IDs for a sequence of
0221  * Unicode code points. Glyph IDs must be returned in a #hb_codepoint_t
0222  * output parameter.
0223  *
0224  * Return value: the number of code points processed
0225  * 
0226  **/
0227 typedef unsigned int (*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font, void *font_data,
0228                                unsigned int count,
0229                                const hb_codepoint_t *first_unicode,
0230                                unsigned int unicode_stride,
0231                                hb_codepoint_t *first_glyph,
0232                                unsigned int glyph_stride,
0233                                void *user_data);
0234 
0235 /**
0236  * hb_font_get_glyph_advance_func_t:
0237  * @font: #hb_font_t to work upon
0238  * @font_data: @font user data pointer
0239  * @glyph: The glyph ID to query
0240  * @user_data: User data pointer passed by the caller
0241  *
0242  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0243  *
0244  * This method should retrieve the advance for a specified glyph. The
0245  * method must return an #hb_position_t.
0246  * 
0247  * Return value: The advance of @glyph within @font
0248  *
0249  **/
0250 typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data,
0251                                hb_codepoint_t glyph,
0252                                void *user_data);
0253 
0254 /**
0255  * hb_font_get_glyph_h_advance_func_t:
0256  *
0257  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0258  *
0259  * This method should retrieve the advance for a specified glyph, in
0260  * horizontal-direction text segments. Advances must be returned in
0261  * an #hb_position_t output parameter.
0262  * 
0263  **/
0264 typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t;
0265 
0266 /**
0267  * hb_font_get_glyph_v_advance_func_t:
0268  *
0269  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0270  *
0271  * This method should retrieve the advance for a specified glyph, in
0272  * vertical-direction text segments. Advances must be returned in
0273  * an #hb_position_t output parameter.
0274  * 
0275  **/
0276 typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;
0277 
0278 /**
0279  * hb_font_get_glyph_advances_func_t:
0280  * @font: #hb_font_t to work upon
0281  * @font_data: @font user data pointer
0282  * @count: The number of glyph IDs in the sequence queried
0283  * @first_glyph: The first glyph ID to query
0284  * @glyph_stride: The stride between successive glyph IDs
0285  * @first_advance: (out): The first advance retrieved
0286  * @advance_stride: The stride between successive advances
0287  * @user_data: User data pointer passed by the caller
0288  *
0289  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0290  *
0291  * This method should retrieve the advances for a sequence of glyphs.
0292  * 
0293  **/
0294 typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_data,
0295                            unsigned int count,
0296                            const hb_codepoint_t *first_glyph,
0297                            unsigned glyph_stride,
0298                            hb_position_t *first_advance,
0299                            unsigned advance_stride,
0300                            void *user_data);
0301 
0302 /**
0303  * hb_font_get_glyph_h_advances_func_t:
0304  *
0305  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0306  *
0307  * This method should retrieve the advances for a sequence of glyphs, in
0308  * horizontal-direction text segments.
0309  * 
0310  **/
0311 typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_h_advances_func_t;
0312 
0313 /**
0314  * hb_font_get_glyph_v_advances_func_t:
0315  *
0316  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0317  *
0318  * This method should retrieve the advances for a sequence of glyphs, in
0319  * vertical-direction text segments.
0320  * 
0321  **/
0322 typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_v_advances_func_t;
0323 
0324 /**
0325  * hb_font_get_glyph_origin_func_t:
0326  * @font: #hb_font_t to work upon
0327  * @font_data: @font user data pointer
0328  * @glyph: The glyph ID to query
0329  * @x: (out): The X coordinate of the origin
0330  * @y: (out): The Y coordinate of the origin
0331  * @user_data: User data pointer passed by the caller
0332  *
0333  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0334  *
0335  * This method should retrieve the (X,Y) coordinates (in scaled units) of the
0336  * origin for a glyph. Each coordinate must be returned in an #hb_position_t
0337  * output parameter.
0338  *
0339  * Return value: `true` if data found, `false` otherwise
0340  * 
0341  **/
0342 typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *font_data,
0343                               hb_codepoint_t glyph,
0344                               hb_position_t *x, hb_position_t *y,
0345                               void *user_data);
0346 
0347 /**
0348  * hb_font_get_glyph_h_origin_func_t:
0349  *
0350  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0351  *
0352  * This method should retrieve the (X,Y) coordinates (in scaled units) of the
0353  * origin for a glyph, for horizontal-direction text segments. Each
0354  * coordinate must be returned in an #hb_position_t output parameter.
0355  * 
0356  **/
0357 typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;
0358 
0359 /**
0360  * hb_font_get_glyph_v_origin_func_t:
0361  *
0362  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0363  *
0364  * This method should retrieve the (X,Y) coordinates (in scaled units) of the
0365  * origin for a glyph, for vertical-direction text segments. Each coordinate
0366  * must be returned in an #hb_position_t output parameter.
0367  * 
0368  **/
0369 typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t;
0370 
0371 /**
0372  * hb_font_get_glyph_origins_func_t:
0373  * @font: #hb_font_t to work upon
0374  * @font_data: @font user data pointer
0375  * @first_glyph: The first glyph ID to query
0376  * @count: number of glyphs to query
0377  * @glyph_stride: The stride between successive glyph IDs
0378  * @first_x: (out): The first origin X coordinate retrieved
0379  * @x_stride: The stride between successive origin X coordinates
0380  * @first_y: (out): The first origin Y coordinate retrieved
0381  * @y_stride: The stride between successive origin Y coordinates
0382  * @user_data: User data pointer passed by the caller
0383  *
0384  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0385  *
0386  * This method should retrieve the (X,Y) coordinates (in scaled units) of the
0387  * origin for each requested glyph. Each coordinate value must be returned in
0388  * an #hb_position_t in the two output parameters.
0389  *
0390  * Return value: `true` if data found, `false` otherwise
0391  *
0392  * Since: 11.3.0
0393  **/
0394 typedef hb_bool_t (*hb_font_get_glyph_origins_func_t) (hb_font_t *font, void *font_data,
0395                                unsigned int count,
0396                                const hb_codepoint_t *first_glyph,
0397                                unsigned glyph_stride,
0398                                hb_position_t *first_x,
0399                                unsigned x_stride,
0400                                hb_position_t *first_y,
0401                                unsigned y_stride,
0402                                void *user_data);
0403 
0404 /**
0405  * hb_font_get_glyph_h_origins_func_t:
0406  *
0407  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0408  *
0409  * This method should retrieve the (X,Y) coordinates (in scaled units) of the
0410  * origin for requested glyph, for horizontal-direction text segments. Each
0411  * coordinate must be returned in a the x/y #hb_position_t output parameters.
0412  *
0413  * Since: 11.3.0
0414  **/
0415 typedef hb_font_get_glyph_origins_func_t hb_font_get_glyph_h_origins_func_t;
0416 
0417 /**
0418  * hb_font_get_glyph_v_origins_func_t:
0419  *
0420  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0421  *
0422  * This method should retrieve the (X,Y) coordinates (in scaled units) of the
0423  * origin for requested glyph, for vertical-direction text segments. Each
0424  * coordinate must be returned in a the x/y #hb_position_t output parameters.
0425  *
0426  * Since: 11.3.0
0427  **/
0428 typedef hb_font_get_glyph_origins_func_t hb_font_get_glyph_v_origins_func_t;
0429 
0430 /**
0431  * hb_font_get_glyph_kerning_func_t:
0432  * @font: #hb_font_t to work upon
0433  * @font_data: @font user data pointer
0434  * @first_glyph: The glyph ID of the first glyph in the glyph pair
0435  * @second_glyph: The glyph ID of the second glyph in the glyph pair
0436  * @user_data: User data pointer passed by the caller
0437  *
0438  * This method should retrieve the kerning-adjustment value for a glyph-pair in
0439  * the specified font, for horizontal text segments.
0440  *
0441  **/
0442 typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data,
0443                                hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
0444                                void *user_data);
0445 /**
0446  * hb_font_get_glyph_h_kerning_func_t:
0447  *
0448  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0449  *
0450  * This method should retrieve the kerning-adjustment value for a glyph-pair in
0451  * the specified font, for horizontal text segments.
0452  *
0453  **/
0454 typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
0455 
0456 
0457 /**
0458  * hb_font_get_glyph_extents_func_t:
0459  * @font: #hb_font_t to work upon
0460  * @font_data: @font user data pointer
0461  * @glyph: The glyph ID to query
0462  * @extents: (out): The #hb_glyph_extents_t retrieved
0463  * @user_data: User data pointer passed by the caller
0464  *
0465  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0466  *
0467  * This method should retrieve the extents for a specified glyph. Extents must be 
0468  * returned in an #hb_glyph_extents output parameter.
0469  *
0470  * Return value: `true` if data found, `false` otherwise
0471  * 
0472  **/
0473 typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data,
0474                                hb_codepoint_t glyph,
0475                                hb_glyph_extents_t *extents,
0476                                void *user_data);
0477 
0478 /**
0479  * hb_font_get_glyph_contour_point_func_t:
0480  * @font: #hb_font_t to work upon
0481  * @font_data: @font user data pointer
0482  * @glyph: The glyph ID to query
0483  * @point_index: The contour-point index to query
0484  * @x: (out): The X value retrieved for the contour point
0485  * @y: (out): The Y value retrieved for the contour point
0486  * @user_data: User data pointer passed by the caller
0487  *
0488  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0489  *
0490  * This method should retrieve the (X,Y) coordinates (in scaled units) for a
0491  * specified contour point in a glyph. Each coordinate must be returned as
0492  * an #hb_position_t output parameter.
0493  * 
0494  * Return value: `true` if data found, `false` otherwise
0495  *
0496  **/
0497 typedef hb_bool_t (*hb_font_get_glyph_contour_point_func_t) (hb_font_t *font, void *font_data,
0498                                  hb_codepoint_t glyph, unsigned int point_index,
0499                                  hb_position_t *x, hb_position_t *y,
0500                                  void *user_data);
0501 
0502 
0503 /**
0504  * hb_font_get_glyph_name_func_t:
0505  * @font: #hb_font_t to work upon
0506  * @font_data: @font user data pointer
0507  * @glyph: The glyph ID to query
0508  * @name: (out) (array length=size): Name string retrieved for the glyph ID
0509  * @size: Length of the glyph-name string retrieved
0510  * @user_data: User data pointer passed by the caller
0511  *
0512  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0513  *
0514  * This method should retrieve the glyph name that corresponds to a
0515  * glyph ID. The name should be returned in a string output parameter.
0516  * 
0517  * Return value: `true` if data found, `false` otherwise
0518  *
0519  **/
0520 typedef hb_bool_t (*hb_font_get_glyph_name_func_t) (hb_font_t *font, void *font_data,
0521                             hb_codepoint_t glyph,
0522                             char *name, unsigned int size,
0523                             void *user_data);
0524 
0525 /**
0526  * hb_font_get_glyph_from_name_func_t:
0527  * @font: #hb_font_t to work upon
0528  * @font_data: @font user data pointer
0529  * @name: (array length=len): The name string to query
0530  * @len: The length of the name queried
0531  * @glyph: (out): The glyph ID retrieved
0532  * @user_data: User data pointer passed by the caller
0533  *
0534  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0535  *
0536  * This method should retrieve the glyph ID that corresponds to a glyph-name
0537  * string. 
0538  * 
0539  * Return value: `true` if data found, `false` otherwise
0540  *
0541  **/
0542 typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *font_data,
0543                              const char *name, int len, /* -1 means nul-terminated */
0544                              hb_codepoint_t *glyph,
0545                              void *user_data);
0546 
0547 /**
0548  * hb_font_draw_glyph_or_fail_func_t:
0549  * @font: #hb_font_t to work upon
0550  * @font_data: @font user data pointer
0551  * @glyph: The glyph ID to query
0552  * @draw_funcs: The draw functions to send the shape data to
0553  * @draw_data: The data accompanying the draw functions
0554  * @user_data: User data pointer passed by the caller
0555  *
0556  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0557  *
0558  * Return value: `true` if glyph was drawn, `false` otherwise
0559  *
0560  * Since: 11.2.0
0561  **/
0562 typedef hb_bool_t (*hb_font_draw_glyph_or_fail_func_t) (hb_font_t *font, void *font_data,
0563                             hb_codepoint_t glyph,
0564                             hb_draw_funcs_t *draw_funcs, void *draw_data,
0565                             void *user_data);
0566 
0567 /**
0568  * hb_font_paint_glyph_or_fail_func_t:
0569  * @font: #hb_font_t to work upon
0570  * @font_data: @font user data pointer
0571  * @glyph: The glyph ID to query
0572  * @paint_funcs: The paint functions to use
0573  * @paint_data: The data accompanying the paint functions
0574  * @palette_index: The color palette to use
0575  * @foreground: The foreground color
0576  * @user_data: User data pointer passed by the caller
0577  *
0578  * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
0579  *
0580  * Return value: `true` if glyph was painted, `false` otherwise
0581  *
0582  * Since: 11.2.0
0583  */
0584 typedef hb_bool_t (*hb_font_paint_glyph_or_fail_func_t) (hb_font_t *font, void *font_data,
0585                              hb_codepoint_t glyph,
0586                              hb_paint_funcs_t *paint_funcs, void *paint_data,
0587                              unsigned int palette_index,
0588                              hb_color_t foreground,
0589                              void *user_data);
0590 
0591 /* func setters */
0592 
0593 /**
0594  * hb_font_funcs_set_font_h_extents_func:
0595  * @ffuncs: A font-function structure
0596  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0597  * @user_data: Data to pass to @func
0598  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0599  *
0600  * Sets the implementation function for #hb_font_get_font_h_extents_func_t.
0601  *
0602  * Since: 1.1.2
0603  **/
0604 HB_EXTERN void
0605 hb_font_funcs_set_font_h_extents_func (hb_font_funcs_t *ffuncs,
0606                        hb_font_get_font_h_extents_func_t func,
0607                        void *user_data, hb_destroy_func_t destroy);
0608 
0609 /**
0610  * hb_font_funcs_set_font_v_extents_func:
0611  * @ffuncs: A font-function structure
0612  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0613  * @user_data: Data to pass to @func
0614  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0615  *
0616  * Sets the implementation function for #hb_font_get_font_v_extents_func_t.
0617  *
0618  * Since: 1.1.2
0619  **/
0620 HB_EXTERN void
0621 hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs,
0622                        hb_font_get_font_v_extents_func_t func,
0623                        void *user_data, hb_destroy_func_t destroy);
0624 
0625 /**
0626  * hb_font_funcs_set_nominal_glyph_func:
0627  * @ffuncs: A font-function structure
0628  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0629  * @user_data: Data to pass to @func
0630  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0631  *
0632  * Sets the implementation function for #hb_font_get_nominal_glyph_func_t.
0633  *
0634  * Since: 1.2.3
0635  **/
0636 HB_EXTERN void
0637 hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs,
0638                       hb_font_get_nominal_glyph_func_t func,
0639                       void *user_data, hb_destroy_func_t destroy);
0640 
0641 /**
0642  * hb_font_funcs_set_nominal_glyphs_func:
0643  * @ffuncs: A font-function structure
0644  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0645  * @user_data: Data to pass to @func
0646  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0647  *
0648  * Sets the implementation function for #hb_font_get_nominal_glyphs_func_t.
0649  *
0650  * Since: 2.0.0
0651  **/
0652 HB_EXTERN void
0653 hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs,
0654                        hb_font_get_nominal_glyphs_func_t func,
0655                        void *user_data, hb_destroy_func_t destroy);
0656 
0657 /**
0658  * hb_font_funcs_set_variation_glyph_func:
0659  * @ffuncs: A font-function structure
0660  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0661  * @user_data: Data to pass to @func
0662  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0663  *
0664  * Sets the implementation function for #hb_font_get_variation_glyph_func_t.
0665  *
0666  * Since: 1.2.3
0667  **/
0668 HB_EXTERN void
0669 hb_font_funcs_set_variation_glyph_func (hb_font_funcs_t *ffuncs,
0670                     hb_font_get_variation_glyph_func_t func,
0671                     void *user_data, hb_destroy_func_t destroy);
0672 
0673 /**
0674  * hb_font_funcs_set_glyph_h_advance_func:
0675  * @ffuncs: A font-function structure
0676  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0677  * @user_data: Data to pass to @func
0678  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0679  *
0680  * Sets the implementation function for #hb_font_get_glyph_h_advance_func_t.
0681  *
0682  * Since: 0.9.2
0683  **/
0684 HB_EXTERN void
0685 hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
0686                     hb_font_get_glyph_h_advance_func_t func,
0687                     void *user_data, hb_destroy_func_t destroy);
0688 
0689 /**
0690  * hb_font_funcs_set_glyph_v_advance_func:
0691  * @ffuncs: A font-function structure
0692  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0693  * @user_data: Data to pass to @func
0694  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0695  *
0696  * Sets the implementation function for #hb_font_get_glyph_v_advance_func_t.
0697  *
0698  * Since: 0.9.2
0699  **/
0700 HB_EXTERN void
0701 hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
0702                     hb_font_get_glyph_v_advance_func_t func,
0703                     void *user_data, hb_destroy_func_t destroy);
0704 
0705 /**
0706  * hb_font_funcs_set_glyph_h_advances_func:
0707  * @ffuncs: A font-function structure
0708  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0709  * @user_data: Data to pass to @func
0710  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0711  *
0712  * Sets the implementation function for #hb_font_get_glyph_h_advances_func_t.
0713  *
0714  * Since: 1.8.6
0715  **/
0716 HB_EXTERN void
0717 hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
0718                     hb_font_get_glyph_h_advances_func_t func,
0719                     void *user_data, hb_destroy_func_t destroy);
0720 
0721 /**
0722  * hb_font_funcs_set_glyph_v_advances_func:
0723  * @ffuncs: A font-function structure
0724  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0725  * @user_data: Data to pass to @func
0726  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0727  *
0728  * Sets the implementation function for #hb_font_get_glyph_v_advances_func_t.
0729  *
0730  * Since: 1.8.6
0731  **/
0732 HB_EXTERN void
0733 hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
0734                     hb_font_get_glyph_v_advances_func_t func,
0735                     void *user_data, hb_destroy_func_t destroy);
0736 
0737 /**
0738  * hb_font_funcs_set_glyph_h_origin_func:
0739  * @ffuncs: A font-function structure
0740  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0741  * @user_data: Data to pass to @func
0742  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0743  *
0744  * Sets the implementation function for #hb_font_get_glyph_h_origin_func_t.
0745  *
0746  * Since: 0.9.2
0747  **/
0748 HB_EXTERN void
0749 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
0750                        hb_font_get_glyph_h_origin_func_t func,
0751                        void *user_data, hb_destroy_func_t destroy);
0752 
0753 /**
0754  * hb_font_funcs_set_glyph_v_origin_func:
0755  * @ffuncs: A font-function structure
0756  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0757  * @user_data: Data to pass to @func
0758  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0759  *
0760  * Sets the implementation function for #hb_font_get_glyph_v_origin_func_t.
0761  *
0762  * Since: 0.9.2
0763  **/
0764 HB_EXTERN void
0765 hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
0766                        hb_font_get_glyph_v_origin_func_t func,
0767                        void *user_data, hb_destroy_func_t destroy);
0768 
0769 /**
0770  * hb_font_funcs_set_glyph_h_origins_func:
0771  * @ffuncs: A font-function structure
0772  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0773  * @user_data: Data to pass to @func
0774  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0775  *
0776  * Sets the implementation function for #hb_font_get_glyph_h_origins_func_t.
0777  *
0778  * Since: 11.3.0
0779  **/
0780 HB_EXTERN void
0781 hb_font_funcs_set_glyph_h_origins_func (hb_font_funcs_t *ffuncs,
0782                     hb_font_get_glyph_h_origins_func_t func,
0783                     void *user_data, hb_destroy_func_t destroy);
0784 
0785 /**
0786  * hb_font_funcs_set_glyph_v_origins_func:
0787  * @ffuncs: A font-function structure
0788  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0789  * @user_data: Data to pass to @func
0790  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0791  *
0792  * Sets the implementation function for #hb_font_get_glyph_v_origins_func_t.
0793  *
0794  * Since: 11.3.0
0795  **/
0796 HB_EXTERN void
0797 hb_font_funcs_set_glyph_v_origins_func (hb_font_funcs_t *ffuncs,
0798                     hb_font_get_glyph_v_origins_func_t func,
0799                     void *user_data, hb_destroy_func_t destroy);
0800 
0801 /**
0802  * hb_font_funcs_set_glyph_h_kerning_func:
0803  * @ffuncs: A font-function structure
0804  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0805  * @user_data: Data to pass to @func
0806  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0807  *
0808  * Sets the implementation function for #hb_font_get_glyph_h_kerning_func_t.
0809  *
0810  * Since: 0.9.2
0811  **/
0812 HB_EXTERN void
0813 hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
0814                     hb_font_get_glyph_h_kerning_func_t func,
0815                     void *user_data, hb_destroy_func_t destroy);
0816 
0817 /**
0818  * hb_font_funcs_set_glyph_extents_func:
0819  * @ffuncs: A font-function structure
0820  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0821  * @user_data: Data to pass to @func
0822  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0823  *
0824  * Sets the implementation function for #hb_font_get_glyph_extents_func_t.
0825  *
0826  * Since: 0.9.2
0827  **/
0828 HB_EXTERN void
0829 hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
0830                       hb_font_get_glyph_extents_func_t func,
0831                       void *user_data, hb_destroy_func_t destroy);
0832 
0833 /**
0834  * hb_font_funcs_set_glyph_contour_point_func:
0835  * @ffuncs: A font-function structure
0836  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0837  * @user_data: Data to pass to @func
0838  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0839  *
0840  * Sets the implementation function for #hb_font_get_glyph_contour_point_func_t.
0841  *
0842  * Since: 0.9.2
0843  **/
0844 HB_EXTERN void
0845 hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
0846                         hb_font_get_glyph_contour_point_func_t func,
0847                         void *user_data, hb_destroy_func_t destroy);
0848 
0849 /**
0850  * hb_font_funcs_set_glyph_name_func:
0851  * @ffuncs: A font-function structure
0852  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0853  * @user_data: Data to pass to @func
0854  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0855  *
0856  * Sets the implementation function for #hb_font_get_glyph_name_func_t.
0857  *
0858  * Since: 0.9.2
0859  **/
0860 HB_EXTERN void
0861 hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
0862                    hb_font_get_glyph_name_func_t func,
0863                    void *user_data, hb_destroy_func_t destroy);
0864 
0865 /**
0866  * hb_font_funcs_set_glyph_from_name_func:
0867  * @ffuncs: A font-function structure
0868  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0869  * @user_data: Data to pass to @func
0870  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0871  *
0872  * Sets the implementation function for #hb_font_get_glyph_from_name_func_t.
0873  *
0874  * Since: 0.9.2
0875  **/
0876 HB_EXTERN void
0877 hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs,
0878                     hb_font_get_glyph_from_name_func_t func,
0879                     void *user_data, hb_destroy_func_t destroy);
0880 
0881 /**
0882  * hb_font_funcs_set_draw_glyph_or_fail_func:
0883  * @ffuncs: A font-function structure
0884  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0885  * @user_data: Data to pass to @func
0886  * @destroy: (nullable): The function to call when @user_data is not needed anymore
0887  *
0888  * Sets the implementation function for #hb_font_draw_glyph_or_fail_func_t.
0889  *
0890  * Since: 11.2.0
0891  **/
0892 HB_EXTERN void
0893 hb_font_funcs_set_draw_glyph_or_fail_func (hb_font_funcs_t *ffuncs,
0894                        hb_font_draw_glyph_or_fail_func_t func,
0895                        void *user_data, hb_destroy_func_t destroy);
0896 
0897 /**
0898  * hb_font_funcs_set_paint_glyph_or_fail_func:
0899  * @ffuncs: A font-function structure
0900  * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
0901  * @user_data: Data to pass to @func
0902  * @destroy: (nullable): The function to call when @user_data is no longer needed
0903  *
0904  * Sets the implementation function for #hb_font_paint_glyph_or_fail_func_t.
0905  *
0906  * Since: 11.2.0
0907  */
0908 HB_EXTERN void
0909 hb_font_funcs_set_paint_glyph_or_fail_func (hb_font_funcs_t *ffuncs,
0910                         hb_font_paint_glyph_or_fail_func_t func,
0911                         void *user_data, hb_destroy_func_t destroy);
0912 
0913 /* func dispatch */
0914 
0915 HB_EXTERN hb_bool_t
0916 hb_font_get_h_extents (hb_font_t *font,
0917                hb_font_extents_t *extents);
0918 HB_EXTERN hb_bool_t
0919 hb_font_get_v_extents (hb_font_t *font,
0920                hb_font_extents_t *extents);
0921 
0922 HB_EXTERN hb_bool_t
0923 hb_font_get_nominal_glyph (hb_font_t *font,
0924                hb_codepoint_t unicode,
0925                hb_codepoint_t *glyph);
0926 HB_EXTERN hb_bool_t
0927 hb_font_get_variation_glyph (hb_font_t *font,
0928                  hb_codepoint_t unicode, hb_codepoint_t variation_selector,
0929                  hb_codepoint_t *glyph);
0930 
0931 HB_EXTERN unsigned int
0932 hb_font_get_nominal_glyphs (hb_font_t *font,
0933                 unsigned int count,
0934                 const hb_codepoint_t *first_unicode,
0935                 unsigned int unicode_stride,
0936                 hb_codepoint_t *first_glyph,
0937                 unsigned int glyph_stride);
0938 
0939 HB_EXTERN hb_position_t
0940 hb_font_get_glyph_h_advance (hb_font_t *font,
0941                  hb_codepoint_t glyph);
0942 HB_EXTERN hb_position_t
0943 hb_font_get_glyph_v_advance (hb_font_t *font,
0944                  hb_codepoint_t glyph);
0945 
0946 HB_EXTERN void
0947 hb_font_get_glyph_h_advances (hb_font_t* font,
0948                   unsigned int count,
0949                   const hb_codepoint_t *first_glyph,
0950                   unsigned glyph_stride,
0951                   hb_position_t *first_advance,
0952                   unsigned advance_stride);
0953 HB_EXTERN void
0954 hb_font_get_glyph_v_advances (hb_font_t* font,
0955                   unsigned int count,
0956                   const hb_codepoint_t *first_glyph,
0957                   unsigned glyph_stride,
0958                   hb_position_t *first_advance,
0959                   unsigned advance_stride);
0960 
0961 HB_EXTERN hb_bool_t
0962 hb_font_get_glyph_h_origin (hb_font_t *font,
0963                 hb_codepoint_t glyph,
0964                 hb_position_t *x, hb_position_t *y);
0965 HB_EXTERN hb_bool_t
0966 hb_font_get_glyph_v_origin (hb_font_t *font,
0967                 hb_codepoint_t glyph,
0968                 hb_position_t *x, hb_position_t *y);
0969 
0970 HB_EXTERN hb_bool_t
0971 hb_font_get_glyph_h_origins (hb_font_t *font,
0972                  unsigned int count,
0973                  const hb_codepoint_t *first_glyph,
0974                  unsigned glyph_stride,
0975                  hb_position_t *first_x,
0976                  unsigned x_stride,
0977                  hb_position_t *first_y,
0978                  unsigned y_stride);
0979 
0980 HB_EXTERN hb_bool_t
0981 hb_font_get_glyph_v_origins (hb_font_t *font,
0982                  unsigned int count,
0983                  const hb_codepoint_t *first_glyph,
0984                  unsigned glyph_stride,
0985                  hb_position_t *first_x,
0986                  unsigned x_stride,
0987                  hb_position_t *first_y,
0988                  unsigned y_stride);
0989 
0990 HB_EXTERN hb_position_t
0991 hb_font_get_glyph_h_kerning (hb_font_t *font,
0992                  hb_codepoint_t left_glyph, hb_codepoint_t right_glyph);
0993 
0994 HB_EXTERN hb_bool_t
0995 hb_font_get_glyph_extents (hb_font_t *font,
0996                hb_codepoint_t glyph,
0997                hb_glyph_extents_t *extents);
0998 
0999 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 */