hb-font: HarfBuzz Manual

## hb-font hb-font — Font objects |

## Functions

void | hb_font_add_glyph_origin_for_direction ()
hb_font_t * | hb_font_create ()
hb_font_t * | hb_font_create_sub_font ()
void | hb_font_destroy ()
hb_font_funcs_t * | hb_font_funcs_create ()
void | hb_font_funcs_destroy ()
hb_font_funcs_t * | hb_font_funcs_get_empty ()
void * | hb_font_funcs_get_user_data ()
hb_bool_t | hb_font_funcs_is_immutable ()
void | hb_font_funcs_make_immutable ()
hb_font_funcs_t * | hb_font_funcs_reference ()
void | hb_font_funcs_set_glyph_contour_point_func ()
void | hb_font_funcs_set_glyph_extents_func ()
void | hb_font_funcs_set_glyph_from_name_func ()
void | hb_font_funcs_set_glyph_h_advance_func ()
void | hb_font_funcs_set_glyph_h_advances_func ()
void | hb_font_funcs_set_glyph_h_kerning_func ()
void | hb_font_funcs_set_glyph_h_origin_func ()
void | hb_font_funcs_set_glyph_name_func ()
void | hb_font_funcs_set_glyph_v_advance_func ()
void | hb_font_funcs_set_glyph_v_advances_func ()
void | hb_font_funcs_set_glyph_v_origin_func ()
void | hb_font_funcs_set_nominal_glyph_func ()
void | hb_font_funcs_set_nominal_glyphs_func ()
hb_bool_t | hb_font_funcs_set_user_data ()
void | hb_font_funcs_set_variation_glyph_func ()
hb_font_t * | hb_font_get_empty ()
hb_face_t * | hb_font_get_face ()
hb_bool_t | hb_font_get_glyph ()
void | hb_font_get_glyph_advance_for_direction ()
hb_position_t | (*hb_font_get_glyph_advance_func_t) ()
void | hb_font_get_glyph_advances_for_direction ()
void | (*hb_font_get_glyph_advances_func_t) ()
hb_bool_t | hb_font_get_glyph_contour_point ()
hb_bool_t | hb_font_get_glyph_contour_point_for_origin ()
hb_bool_t | (*hb_font_get_glyph_contour_point_func_t) ()
hb_bool_t | hb_font_get_glyph_extents ()
hb_bool_t | hb_font_get_glyph_extents_for_origin ()
hb_bool_t | (*hb_font_get_glyph_extents_func_t) ()
hb_bool_t | hb_font_get_glyph_from_name ()
hb_bool_t | (*hb_font_get_glyph_from_name_func_t) ()
hb_position_t | hb_font_get_glyph_h_advance ()
void | hb_font_get_glyph_h_advances ()
hb_position_t | hb_font_get_glyph_h_kerning ()
hb_bool_t | hb_font_get_glyph_h_origin ()
void | hb_font_get_glyph_kerning_for_direction ()
hb_position_t | (*hb_font_get_glyph_kerning_func_t) ()
hb_bool_t | hb_font_get_glyph_name ()
hb_bool_t | (*hb_font_get_glyph_name_func_t) ()
void | hb_font_get_glyph_origin_for_direction ()
hb_bool_t | (*hb_font_get_glyph_origin_func_t) ()
hb_position_t | hb_font_get_glyph_v_advance ()
void | hb_font_get_glyph_v_advances ()
hb_bool_t | hb_font_get_glyph_v_origin ()
hb_bool_t | hb_font_get_nominal_glyph ()
hb_bool_t | (*hb_font_get_nominal_glyph_func_t) ()
unsigned int | hb_font_get_nominal_glyphs ()
hb_font_t * | hb_font_get_parent ()
void | hb_font_get_ppem ()
float | hb_font_get_ptem ()
void | hb_font_get_scale ()
void * | hb_font_get_user_data ()
hb_bool_t | hb_font_get_variation_glyph ()
hb_bool_t | (*hb_font_get_variation_glyph_func_t) ()
const int * | hb_font_get_var_coords_normalized ()
hb_bool_t | hb_font_glyph_from_string ()
void | hb_font_glyph_to_string ()
hb_bool_t | hb_font_is_immutable ()
void | hb_font_make_immutable ()
hb_font_t * | hb_font_reference ()
void | hb_font_set_face ()
void | hb_font_set_funcs ()
void | hb_font_set_funcs_data ()
void | hb_font_set_parent ()
void | hb_font_set_ppem ()
void | hb_font_set_ptem ()
void | hb_font_set_scale ()
hb_bool_t | hb_font_set_user_data ()
void | hb_font_set_variations ()
void | hb_font_set_var_coords_design ()
void | hb_font_set_var_coords_normalized ()
void | hb_font_set_var_named_instance ()
void | hb_font_subtract_glyph_origin_for_direction ()
hb_blob_t * | (*hb_reference_table_func_t) ()
void | hb_font_funcs_set_font_h_extents_func ()
void | hb_font_funcs_set_font_v_extents_func ()
void | hb_font_get_extents_for_direction ()
hb_bool_t | (*hb_font_get_font_extents_func_t) ()
hb_bool_t | hb_font_get_h_extents ()
hb_bool_t | hb_font_get_v_extents ()

## Types and Values

typedef | hb_font_funcs_t
typedef | hb_font_get_glyph_h_advance_func_t
typedef | hb_font_get_glyph_h_advances_func_t
typedef | hb_font_get_glyph_h_kerning_func_t
typedef | hb_font_get_glyph_h_origin_func_t
typedef | hb_font_get_glyph_v_advance_func_t
typedef | hb_font_get_glyph_v_advances_func_t
typedef | hb_font_get_glyph_v_origin_func_t
typedef | hb_font_t
typedef | hb_font_get_font_h_extents_func_t
typedef | hb_font_get_font_v_extents_func_t

## Object Hierarchy

        GBoxed
        ├── hb_font_funcs_t
        ╰── hb_font_t

## Includes

    #include <hb.h>

## Description

Font objects represent a font face at a certain size and other parameters (pixels per EM, points per EM, variation settings.) Fonts are created from font faces, and are used as input to `hb_shape()` among other things.

## Functions

### hb_font_add_glyph_origin_for_direction ()

    void
    hb_font_add_glyph_origin_for_direction
                                   (hb_font_t *font,
                                    hb_codepoint_t glyph,
                                    hb_direction_t direction,
                                    hb_position_t *x,
                                    hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_create ()

    hb_font_t *
    hb_font_create (hb_face_t *face);

[Xconstructor]

#### Parameters

face | a face. |

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_font_create_sub_font ()

    hb_font_t *
    hb_font_create_sub_font (hb_font_t *parent);

#### Parameters

parent | parent font. |

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_font_destroy ()

    void
    hb_font_destroy (hb_font_t *font);

[skip]

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_funcs_create ()

    hb_font_funcs_t *
    hb_font_funcs_create (void);

[Xconstructor]

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_font_funcs_destroy ()

    void
    hb_font_funcs_destroy (hb_font_funcs_t *ffuncs);

[skip]

#### Parameters

ffuncs | font functions. |

Since: 0.9.2

### hb_font_funcs_get_empty ()

    hb_font_funcs_t *
    hb_font_funcs_get_empty (void);

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_font_funcs_get_user_data ()

    void *
    hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
                                 hb_user_data_key_t *key);

[skip]

#### Parameters

ffuncs | font functions. |

#### Returns

.

[transfer none]

Since: 0.9.2

### hb_font_funcs_is_immutable ()

    hb_bool_t
    hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs);

#### Parameters

ffuncs | font functions. |

Since: 0.9.2

### hb_font_funcs_make_immutable ()

    void
    hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);

#### Parameters

ffuncs | font functions. |

Since: 0.9.2

### hb_font_funcs_reference ()

    hb_font_funcs_t *
    hb_font_funcs_reference (hb_font_funcs_t *ffuncs);

[skip]

#### Parameters

ffuncs | font functions. |

Since: 0.9.2

### hb_font_funcs_set_glyph_contour_point_func ()

    void
    hb_font_funcs_set_glyph_contour_point_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_glyph_contour_point_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_extents_func ()

    void
    hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
                                          hb_font_get_glyph_extents_func_t func,
                                          void *user_data,
                                          hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_from_name_func ()

    void
    hb_font_funcs_set_glyph_from_name_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_glyph_from_name_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_h_advance_func ()

    void
    hb_font_funcs_set_glyph_h_advance_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_glyph_h_advance_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_h_advances_func ()

    void
    hb_font_funcs_set_glyph_h_advances_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_glyph_h_advances_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 1.8.6

### hb_font_funcs_set_glyph_h_kerning_func ()

    void
    hb_font_funcs_set_glyph_h_kerning_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_glyph_h_kerning_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_h_origin_func ()

    void
    hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
                                           hb_font_get_glyph_h_origin_func_t func,
                                           void *user_data,
                                           hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_name_func ()

    void
    hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
                                       hb_font_get_glyph_name_func_t func,
                                       void *user_data,
                                       hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_v_advance_func ()

    void
    hb_font_funcs_set_glyph_v_advance_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_glyph_v_advance_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_glyph_v_advances_func ()

    void
    hb_font_funcs_set_glyph_v_advances_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_glyph_v_advances_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 1.8.6

### hb_font_funcs_set_glyph_v_origin_func ()

    void
    hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
                                           hb_font_get_glyph_v_origin_func_t func,
                                           void *user_data,
                                           hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_funcs_set_nominal_glyph_func ()

    void
    hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs,
                                          hb_font_get_nominal_glyph_func_t func,
                                          void *user_data,
                                          hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 1.2.3

### hb_font_funcs_set_nominal_glyphs_func ()

    void
    hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs,
                                           hb_font_get_nominal_glyphs_func_t func,
                                           void *user_data,
                                           hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 2.0.0

### hb_font_funcs_set_user_data ()

    hb_bool_t
    hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
                                 hb_user_data_key_t *key,
                                 void *data,
                                 hb_destroy_func_t destroy,
                                 hb_bool_t replace);

[skip]

#### Parameters

ffuncs | font functions. |

Since: 0.9.2

### hb_font_funcs_set_variation_glyph_func ()

    void
    hb_font_funcs_set_variation_glyph_func
                                   (hb_font_funcs_t *ffuncs,
                                    hb_font_get_variation_glyph_func_t func,
                                    void *user_data,
                                    hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 1.2.3

### hb_font_get_empty ()

    hb_font_t *
    hb_font_get_empty (void);

#### Returns

(transfer full)

Since: 0.9.2

### hb_font_get_face ()

    hb_face_t *
    hb_font_get_face (hb_font_t *font);

#### Parameters

font | a font. |

#### Returns

.

[transfer none]

Since: 0.9.2

### hb_font_get_glyph ()

    hb_bool_t
    hb_font_get_glyph (hb_font_t *font,
                       hb_codepoint_t unicode,
                       hb_codepoint_t variation_selector,
                       hb_codepoint_t *glyph);

#### Parameters

font | a font. |
glyph | . | [out]

Since: 0.9.2

### hb_font_get_glyph_advance_for_direction ()

    void
    hb_font_get_glyph_advance_for_direction
                                   (hb_font_t *font,
                                    hb_codepoint_t glyph,
                                    hb_direction_t direction,
                                    hb_position_t *x,
                                    hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_get_glyph_advance_func_t ()

    hb_position_t
    (*hb_font_get_glyph_advance_func_t) (hb_font_t *font,
                                         void *font_data,
                                         hb_codepoint_t glyph,
                                         void *user_data);

### hb_font_get_glyph_advances_for_direction ()

    void
    hb_font_get_glyph_advances_for_direction
                                   (hb_font_t *font,
                                    hb_direction_t direction,
                                    unsigned int count,
                                    const hb_codepoint_t *first_glyph,
                                    unsigned  glyph_stride,
                                    hb_position_t *first_advance,
                                    unsigned  advance_stride);

#### Parameters

font | a font. |

Since: 1.8.6

### hb_font_get_glyph_advances_func_t ()

    void
    (*hb_font_get_glyph_advances_func_t) (hb_font_t *font,
                                          void *font_data,
                                          unsigned int count,
                                          const hb_codepoint_t *first_glyph,
                                          unsigned  glyph_stride,
                                          hb_position_t *first_advance,
                                          unsigned  advance_stride,
                                          void *user_data);

### hb_font_get_glyph_contour_point ()

    hb_bool_t
    hb_font_get_glyph_contour_point (hb_font_t *font,
                                     hb_codepoint_t glyph,
                                     unsigned int point_index,
                                     hb_position_t *x,
                                     hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_get_glyph_contour_point_for_origin ()

    hb_bool_t
    hb_font_get_glyph_contour_point_for_origin
                                   (hb_font_t *font,
                                    hb_codepoint_t glyph,
                                    unsigned int point_index,
                                    hb_direction_t direction,
                                    hb_position_t *x,
                                    hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_get_glyph_contour_point_func_t ()

    hb_bool_t
    (*hb_font_get_glyph_contour_point_func_t)
                                   (hb_font_t *font,
                                    void *font_data,
                                    hb_codepoint_t glyph,
                                    unsigned int point_index,
                                    hb_position_t *x,
                                    hb_position_t *y,
                                    void *user_data);

### hb_font_get_glyph_extents ()

    hb_bool_t
    hb_font_get_glyph_extents (hb_font_t *font,
                               hb_codepoint_t glyph,
                               hb_glyph_extents_t *extents);

#### Parameters

font | a font. |
extents | . | [out]

Since: 0.9.2

### hb_font_get_glyph_extents_for_origin ()

    hb_bool_t
    hb_font_get_glyph_extents_for_origin (hb_font_t *font,
                                          hb_codepoint_t glyph,
                                          hb_direction_t direction,
                                          hb_glyph_extents_t *extents);

#### Parameters

font | a font. |
extents | . | [out]

Since: 0.9.2

### hb_font_get_glyph_extents_func_t ()

    hb_bool_t
    (*hb_font_get_glyph_extents_func_t) (hb_font_t *font,
                                         void *font_data,
                                         hb_codepoint_t glyph,
                                         hb_glyph_extents_t *extents,
                                         void *user_data);

### hb_font_get_glyph_from_name ()

    hb_bool_t
    hb_font_get_glyph_from_name (hb_font_t *font,
                                 const char *name,
                                 int len,
                                 hb_codepoint_t *glyph);

#### Parameters

font | a font. |
name | . | [array length=len]
glyph | . | [out]

Since: 0.9.2

### hb_font_get_glyph_from_name_func_t ()

    hb_bool_t
    (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font,
                                           void *font_data,
                                           const char *name,
                                           int len);

### hb_font_get_glyph_h_advance ()

    hb_position_t
    hb_font_get_glyph_h_advance (hb_font_t *font,
                                 hb_codepoint_t glyph);

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_get_glyph_h_advances ()

    void
    hb_font_get_glyph_h_advances (hb_font_t *font,
                                  unsigned int count,
                                  const hb_codepoint_t *first_glyph,
                                  unsigned  glyph_stride,
                                  hb_position_t *first_advance,
                                  unsigned  advance_stride);

#### Parameters

font | a font. |

Since: 1.8.6

### hb_font_get_glyph_h_kerning ()

    hb_position_t
    hb_font_get_glyph_h_kerning (hb_font_t *font,
                                 hb_codepoint_t left_glyph,
                                 hb_codepoint_t right_glyph);

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_get_glyph_h_origin ()

    hb_bool_t
    hb_font_get_glyph_h_origin (hb_font_t *font,
                                hb_codepoint_t glyph,
                                hb_position_t *x,
                                hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_get_glyph_kerning_for_direction ()

    void
    hb_font_get_glyph_kerning_for_direction
                                   (hb_font_t *font,
                                    hb_codepoint_t first_glyph,
                                    hb_codepoint_t second_glyph,
                                    hb_direction_t direction,
                                    hb_position_t *x,
                                    hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_get_glyph_kerning_func_t ()

    hb_position_t
    (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font,
                                         void *font_data,
                                         hb_codepoint_t first_glyph,
                                         hb_codepoint_t second_glyph,
                                         void *user_data);

### hb_font_get_glyph_name ()

    hb_bool_t
    hb_font_get_glyph_name (hb_font_t *font,
                            hb_codepoint_t glyph,
                            char *name,
                            unsigned int size);

#### Parameters

font | a font. |
name | . | [array length=size]

Since: 0.9.2

### hb_font_get_glyph_name_func_t ()

    hb_bool_t
    (*hb_font_get_glyph_name_func_t) (hb_font_t *font,
                                      void *font_data,
                                      hb_codepoint_t glyph,
                                      char *name,
                                      unsigned int size,
                                      void *user_data);

### hb_font_get_glyph_origin_for_direction ()

    void
    hb_font_get_glyph_origin_for_direction
                                   (hb_font_t *font,
                                    hb_codepoint_t glyph,
                                    hb_direction_t direction,
                                    hb_position_t *x,
                                    hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_get_glyph_origin_func_t ()

    hb_bool_t
    (*hb_font_get_glyph_origin_func_t) (hb_font_t *font,
                                        void *font_data,
                                        hb_codepoint_t glyph,
                                        hb_position_t *x,
                                        hb_position_t *y,
                                        void *user_data);

### hb_font_get_glyph_v_advance ()

    hb_position_t
    hb_font_get_glyph_v_advance (hb_font_t *font,
                                 hb_codepoint_t glyph);

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_get_glyph_v_advances ()

    void
    hb_font_get_glyph_v_advances (hb_font_t *font,
                                  unsigned int count,
                                  const hb_codepoint_t *first_glyph,
                                  unsigned  glyph_stride,
                                  hb_position_t *first_advance,
                                  unsigned  advance_stride);

#### Parameters

font | a font. |

Since: 1.8.6

### hb_font_get_glyph_v_origin ()

    hb_bool_t
    hb_font_get_glyph_v_origin (hb_font_t *font,
                                hb_codepoint_t glyph,
                                hb_position_t *x,
                                hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_font_get_nominal_glyph ()

    hb_bool_t
    hb_font_get_nominal_glyph (hb_font_t *font,
                               hb_codepoint_t unicode,
                               hb_codepoint_t *glyph);

#### Parameters

font | a font. |
glyph | . | [out]

Since: 1.2.3

### hb_font_get_nominal_glyph_func_t ()

    hb_bool_t
    (*hb_font_get_nominal_glyph_func_t) (hb_font_t *font,
                                         void *font_data,
                                         hb_codepoint_t unicode,
                                         hb_codepoint_t *glyph,
                                         void *user_data);

### hb_font_get_nominal_glyphs ()

    unsigned int
    hb_font_get_nominal_glyphs (hb_font_t *font,
                                unsigned int count,
                                const hb_codepoint_t *first_unicode,
                                unsigned int unicode_stride,
                                hb_codepoint_t *first_glyph,
                                unsigned int glyph_stride);

#### Parameters

font | a font. |

Since: 2.6.3

### hb_font_get_parent ()

    hb_font_t *
    hb_font_get_parent (hb_font_t *font);

#### Parameters

font | a font. |

#### Returns

.

[transfer none]

Since: 0.9.2

### hb_font_get_ppem ()

    void
    hb_font_get_ppem (hb_font_t *font,
                      unsigned int *x_ppem,
                      unsigned int *y_ppem);

#### Parameters

font | a font. |
x_ppem | . | [out]
y_ppem | . | [out]

Since: 0.9.2

### hb_font_get_ptem ()

    float
    hb_font_get_ptem (hb_font_t *font);

Gets the "point size" of the font. A value of 0 means unset.

#### Parameters

font | a font. |

#### Returns

Point size.

Since: 0.9.2

### hb_font_get_scale ()

    void
    hb_font_get_scale (hb_font_t *font,
                       int *x_scale,
                       int *y_scale);

#### Parameters

font | a font. |
x_scale | . | [out]
y_scale | . | [out]

Since: 0.9.2

### hb_font_get_user_data ()

    void *
    hb_font_get_user_data (hb_font_t *font,
                           hb_user_data_key_t *key);

[skip]

#### Parameters

font | a font. |

#### Returns

.

[transfer none]

Since: 0.9.2

### hb_font_get_variation_glyph ()

    hb_bool_t
    hb_font_get_variation_glyph (hb_font_t *font,
                                 hb_codepoint_t unicode,
                                 hb_codepoint_t variation_selector,
                                 hb_codepoint_t *glyph);

#### Parameters

font | a font. |
glyph | . | [out]

Since: 1.2.3

### hb_font_get_variation_glyph_func_t ()

    hb_bool_t
    (*hb_font_get_variation_glyph_func_t) (hb_font_t *font,
                                           void *font_data,
                                           hb_codepoint_t unicode,
                                           hb_codepoint_t variation_selector,
                                           hb_codepoint_t *glyph,
                                           void *user_data);

### hb_font_get_var_coords_normalized ()

    const int *
    hb_font_get_var_coords_normalized (hb_font_t *font,
                                       unsigned int *length);

Return value is valid as long as variation coordinates of the font are not modified.

Since: 1.4.2

### hb_font_glyph_from_string ()

    hb_bool_t
    hb_font_glyph_from_string (hb_font_t *font,
                               const char *s,
                               int len,
                               hb_codepoint_t *glyph);

#### Parameters

font | a font. |
s | . | [array length=len][element-type uint8_t]
glyph | . | [out]

Since: 0.9.2

### hb_font_glyph_to_string ()

    void
    hb_font_glyph_to_string (hb_font_t *font,
                             hb_codepoint_t glyph,
                             char *s,
                             unsigned int size);

#### Parameters

font | a font. |
s | . | [array length=size]

Since: 0.9.2

### hb_font_is_immutable ()

    hb_bool_t
    hb_font_is_immutable (hb_font_t *font);

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_make_immutable ()

    void
    hb_font_make_immutable (hb_font_t *font);

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_reference ()

    hb_font_t *
    hb_font_reference (hb_font_t *font);

[skip]

#### Parameters

font | a font. |

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_font_set_face ()

    void
    hb_font_set_face (hb_font_t *font,
                      hb_face_t *face);

Sets font-face of `font` .

#### Parameters

font | a font. |
face | new face. |

Since: 1.4.3

### hb_font_set_funcs ()

    void
    hb_font_set_funcs (hb_font_t *font,
                       hb_font_funcs_t *klass,
                       void *font_data,
                       hb_destroy_func_t destroy);

#### Parameters

font | a font. |
klass | . | [closure font_data][destroy destroy][scope notified]

Since: 0.9.2

### hb_font_set_funcs_data ()

    void
    hb_font_set_funcs_data (hb_font_t *font,
                            void *font_data,
                            hb_destroy_func_t destroy);

#### Parameters

font | a font. |
font_data | . | [destroy destroy][scope notified]

Since: 0.9.2

### hb_font_set_parent ()

    void
    hb_font_set_parent (hb_font_t *font,
                        hb_font_t *parent);

Sets parent font of `font` .

#### Parameters

font | a font. |
parent | new parent. |

Since: 1.0.5

### hb_font_set_ppem ()

    void
    hb_font_set_ppem (hb_font_t *font,
                      unsigned int x_ppem,
                      unsigned int y_ppem);

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_set_ptem ()

    void
    hb_font_set_ptem (hb_font_t *font,
                      float ptem);

Sets "point size" of the font. Set to 0 to unset.

There are 72 points in an inch.

#### Parameters

font | a font. |
ptem | font size in points. |

Since: 1.6.0

### hb_font_set_scale ()

    void
    hb_font_set_scale (hb_font_t *font,
                       int x_scale,
                       int y_scale);

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_set_user_data ()

    hb_bool_t
    hb_font_set_user_data (hb_font_t *font,
                           hb_user_data_key_t *key,
                           void *data,
                           hb_destroy_func_t destroy,
                           hb_bool_t replace);

[skip]

#### Parameters

font | a font. |

Since: 0.9.2

### hb_font_set_variations ()

    void
    hb_font_set_variations (hb_font_t *font,
                            const hb_variation_t *variations,
                            unsigned int variations_length);

Since: 1.4.2

### hb_font_set_var_coords_design ()

    void
    hb_font_set_var_coords_design (hb_font_t *font,
                                   const float *coords,
                                   unsigned int coords_length);

Since: 1.4.2

### hb_font_set_var_coords_normalized ()

    void
    hb_font_set_var_coords_normalized (hb_font_t *font,
                                       const int *coords,
                                       unsigned int coords_length);

Since: 1.4.2

### hb_font_set_var_named_instance ()

    void
    hb_font_set_var_named_instance (hb_font_t *font,
                                    unsigned  instance_index);

Sets design coords of a font from a named instance index.

#### Parameters

font | a font. |
instance_index | named instance index. |

Since: 2.6.0

### hb_font_subtract_glyph_origin_for_direction ()

    void
    hb_font_subtract_glyph_origin_for_direction
                                   (hb_font_t *font,
                                    hb_codepoint_t glyph,
                                    hb_direction_t direction,
                                    hb_position_t *x,
                                    hb_position_t *y);

#### Parameters

font | a font. |
x | . | [out]
y | . | [out]

Since: 0.9.2

### hb_reference_table_func_t ()

    hb_blob_t *
    (*hb_reference_table_func_t) (hb_face_t *face,
                                  hb_tag_t tag,
                                  void *user_data);

### hb_font_funcs_set_font_h_extents_func ()

    void
    hb_font_funcs_set_font_h_extents_func (hb_font_funcs_t *ffuncs,
                                           hb_font_get_font_h_extents_func_t func,
                                           void *user_data,
                                           hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 1.1.2

### hb_font_funcs_set_font_v_extents_func ()

    void
    hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs,
                                           hb_font_get_font_v_extents_func_t func,
                                           void *user_data,
                                           hb_destroy_func_t destroy);

#### Parameters

ffuncs | font functions. |
func | . | [closure user_data][destroy destroy][scope notified]

Since: 1.1.2

### hb_font_get_extents_for_direction ()

    void
    hb_font_get_extents_for_direction (hb_font_t *font,
                                       hb_direction_t direction,
                                       hb_font_extents_t *extents);

#### Parameters

font | a font. |
extents | . | [out]

Since: 1.1.3

### hb_font_get_font_extents_func_t ()

    hb_bool_t
    (*hb_font_get_font_extents_func_t) (hb_font_t *font,
                                        void *font_data,
                                        hb_font_extents_t *extents,
                                        void *user_data);

### hb_font_get_h_extents ()

    hb_bool_t
    hb_font_get_h_extents (hb_font_t *font,
                           hb_font_extents_t *extents);

#### Parameters

font | a font. |
extents | . | [out]

Since: 1.1.3

### hb_font_get_v_extents ()

    hb_bool_t
    hb_font_get_v_extents (hb_font_t *font,
                           hb_font_extents_t *extents);

#### Parameters

font | a font. |
extents | . | [out]

Since: 1.1.3

## Types and Values

### hb_font_funcs_t

    typedef struct hb_font_funcs_t hb_font_funcs_t;

### hb_font_get_glyph_h_advance_func_t

    typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t;

### hb_font_get_glyph_h_advances_func_t

    typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_h_advances_func_t;

### hb_font_get_glyph_h_kerning_func_t

    typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;

### hb_font_get_glyph_h_origin_func_t

    typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;

### hb_font_get_glyph_v_advance_func_t

    typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;

### hb_font_get_glyph_v_advances_func_t

    typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_v_advances_func_t;

### hb_font_get_glyph_v_origin_func_t

    typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t;

### hb_font_t

    typedef struct hb_font_t hb_font_t;

### hb_font_get_font_h_extents_func_t

    typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t;

### hb_font_get_font_v_extents_func_t

    typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t;