hb-directwrite: HarfBuzz Manual

## hb-directwrite hb-directwrite — DirectWrite integration |

## Functions

hb_face_t * | hb_directwrite_face_create ()
hb_face_t * | hb_directwrite_face_create_from_file_or_fail ()
hb_face_t * | hb_directwrite_face_create_from_blob_or_fail ()
IDWriteFontFace * | hb_directwrite_face_get_dw_font_face ()
hb_font_t * | hb_directwrite_font_create ()
IDWriteFontFace * | hb_directwrite_font_get_dw_font_face ()
void | hb_directwrite_font_set_funcs ()

## Includes

    #include <hb-directwrite.h>

## Description

Functions for using HarfBuzz with DirectWrite fonts.

## Functions

### hb_directwrite_face_create ()

    hb_face_t *
    hb_directwrite_face_create (IDWriteFontFace *dw_face);

Constructs a new face object from the specified DirectWrite IDWriteFontFace.

#### Parameters

dw_face | a DirectWrite IDWriteFontFace object. |

#### Returns

hb_face_t object corresponding to the given input

Since: 2.4.0

### hb_directwrite_face_create_from_file_or_fail ()

    hb_face_t *
    hb_directwrite_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 DirectWrite 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: 11.0.0

### hb_directwrite_face_create_from_blob_or_fail ()

    hb_face_t *
    hb_directwrite_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 DirectWrite 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_directwrite_face_get_dw_font_face ()

    IDWriteFontFace *
    hb_directwrite_face_get_dw_font_face (hb_face_t *face);

Gets the DirectWrite IDWriteFontFace associated with `face` .

#### Parameters

face | a hb_face_t object |

#### Returns

DirectWrite IDWriteFontFace object corresponding to the given input

Since: 10.4.0

### hb_directwrite_font_create ()

    hb_font_t *
    hb_directwrite_font_create (IDWriteFontFace *dw_face);

Constructs a new font object from the specified DirectWrite IDWriteFontFace.

#### Parameters

dw_face | a DirectWrite IDWriteFontFace object. |

#### Returns

hb_font_t object corresponding to the given input

Since: 11.0.0

### hb_directwrite_font_get_dw_font_face ()

    IDWriteFontFace *
    hb_directwrite_font_get_dw_font_face (hb_font_t *font);

Gets the DirectWrite IDWriteFontFace associated with `font` .

#### Parameters

font | a hb_font_t object |

#### Returns

DirectWrite IDWriteFontFace object corresponding to the given input

Since: 11.0.0

### hb_directwrite_font_set_funcs ()

    void
    hb_directwrite_font_set_funcs (hb_font_t *font);

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

In particular, you can use this function to configure an existing hb_face_t face object for use with DirectWrite 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 DirectWrite font functions.

Note: Internally, this function creates a DirectWrite font.

#### Parameters

font | hb_font_t to work upon |

Since: 11.0.0