IDWriteFactory6::CreateFontFaceReference method (dwrite_3.h)

Creates a reference to a specific font instance within a file.

Syntax

HRESULT CreateFontFaceReference(
        IDWriteFontFile              *fontFile,
        UINT32                       faceIndex,
        DWRITE_FONT_SIMULATIONS      fontSimulations,
        DWRITE_FONT_AXIS_VALUE const *fontAxisValues,
        UINT32                       fontAxisValueCount,
  [out] IDWriteFontFaceReference1    **fontFaceReference
);

Parameters

fontFile

Type: IDWriteFontFile*

A user-provided font file representing the font face.

faceIndex

Type: UINT32

The zero-based index of a font face in cases when the font file contains a collection of font faces. If the font file contains a single face, then set this value to zero.

fontSimulations

Type: DWRITE_FONT_SIMULATIONS

Font face simulation flags for algorithmic emboldening and italicization.

fontAxisValues

Type: DWRITE_FONT_AXIS_VALUE const *

A pointer to an array containing a list of font axis values. The array should be the size (the number of elements) indicated by the fontAxisValueCount argument.

fontAxisValueCount

Type: UINT32

The number of font axis values contained in the fontAxisValues array.

[out] fontFaceReference

Type: IDWriteFontFaceReference1**

The address of a pointer to an IDWriteFontFaceReference1 interface. On successful completion, the function sets the pointer to a newly created font face reference object, otherwise it sets the pointer to nullptr.

Return value

Type: HRESULT

If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Target Platform Windows
Header dwrite_3.h
Library Dwrite.lib