hb-coretext: HarfBuzz Manual

## hb-coretext hb-coretext — CoreText integration |

## Functions

hb_face_t * | hb_coretext_face_create ()
hb_face_t * | hb_coretext_face_create_from_file_or_fail ()
hb_face_t * | hb_coretext_face_create_from_blob_or_fail ()
hb_font_t * | hb_coretext_font_create ()
CGFontRef | hb_coretext_face_get_cg_font ()
CTFontRef | hb_coretext_font_get_ct_font ()
void | hb_coretext_font_set_funcs ()

## Types and Values

#define | HB_CORETEXT_TAG_KERX
#define | HB_CORETEXT_TAG_MORT
#define | HB_CORETEXT_TAG_MORX

## Includes

    #include <hb-coretext.h>

## Description

Functions for using HarfBuzz with the CoreText fonts.

## Functions

### hb_coretext_face_create ()

    hb_face_t *
    hb_coretext_face_create (CGFontRef cg_font);

Creates an hb_face_t face object from the specified CGFontRef.

#### Parameters

cg_font | The CGFontRef to work upon |

#### Returns

The new face object.

[transfer full]

Since: 0.9.10

### hb_coretext_face_create_from_file_or_fail ()

    hb_face_t *
    hb_coretext_face_create_from_file_or_fail
                                   (const char *file_name,
                                    unsigned int index);

Creates an hb_face_t face object from the specified font file and face index.

This is similar in functionality to `hb_face_create_from_file_or_fail()`, but uses the CoreText library for loading the font file.

#### Parameters

file_name | A font filename |
index | The index of the face within the file |

#### Returns

The new face object, or `NULL` if no face is found at the specified index or the file cannot be read.

[transfer full]

Since: 10.1.0

### hb_coretext_face_create_from_blob_or_fail ()

    hb_face_t *
    hb_coretext_face_create_from_blob_or_fail
                                   (hb_blob_t *blob,
                                    unsigned int index);

Creates an hb_face_t face object from the specified blob and face index.

This is similar in functionality to `hb_face_create_from_blob_or_fail()`, but uses the CoreText library for loading the font data.

#### Parameters

blob | A blob containing the font data |
index | The index of the face within the blob |

#### Returns

The new face object, or `NULL` if no face is found at the specified index or the blob cannot be read.

[transfer full]

Since: 11.0.0

### hb_coretext_font_create ()

    hb_font_t *
    hb_coretext_font_create (CTFontRef ct_font);

Creates an hb_font_t font object from the specified CTFontRef.

The created font uses the default font functions implemented natively by HarfBuzz. If you want to use the CoreText font functions instead (rarely needed), you can do so by calling by `hb_coretext_font_set_funcs()`.

#### Parameters

ct_font | The CTFontRef to work upon |

#### Returns

The new font object.

[transfer full]

Since: 1.7.2

### hb_coretext_face_get_cg_font ()

    CGFontRef
    hb_coretext_face_get_cg_font (hb_face_t *face);

Fetches the CGFontRef associated with an hb_face_t face object

#### Parameters

face | The hb_face_t to work upon |

#### Returns

the CGFontRef found

Since: 0.9.10

### hb_coretext_font_get_ct_font ()

    CTFontRef
    hb_coretext_font_get_ct_font (hb_font_t *font);

Fetches the CTFontRef associated with the specified hb_font_t font object.

#### Parameters

font | hb_font_t to work upon |

#### Returns

the CTFontRef found

Since: 0.9.10

### hb_coretext_font_set_funcs ()

    void
    hb_coretext_font_set_funcs (hb_font_t *font);

Configures the font-functions structure of the specified hb_font_t font object to use CoreText font functions.

In particular, you can use this function to configure an existing hb_face_t face object for use with CoreText font functions even if that hb_face_t face object was initially created with `hb_face_create()`, and therefore was not initially configured to use CoreText font functions.

Note: Internally, this function creates a CTFont.

#### Parameters

font | hb_font_t to work upon |

Since: 10.1.0

## Types and Values

### HB_CORETEXT_TAG_KERX

    #define HB_CORETEXT_TAG_KERX HB_TAG('k','e','r','x')

The hb_tag_t tag for the `kerx` (extended kerning) table, which holds AAT kerning information.

For more information, see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6kerx.html

### HB_CORETEXT_TAG_MORT

    #define HB_CORETEXT_TAG_MORT HB_TAG('m','o','r','t')

The hb_tag_t tag for the `mort` (glyph metamorphosis) table, which holds AAT features.

For more information, see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6mort.html

### HB_CORETEXT_TAG_MORX

    #define HB_CORETEXT_TAG_MORX HB_TAG('m','o','r','x')

The hb_tag_t tag for the `morx` (extended glyph metamorphosis) table, which holds AAT features.

For more information, see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html