IDWriteFontSetBuilder2::AddFont method (dwrite_3.h)
Adds a font to the set being built, with the caller supplying enough information to search on and determine axis ranges, avoiding the need to open the potentially non-local font.
Syntax
HRESULT AddFont(
IDWriteFontFile *fontFile,
UINT32 fontFaceIndex,
DWRITE_FONT_SIMULATIONS fontSimulations,
DWRITE_FONT_AXIS_VALUE const *fontAxisValues,
UINT32 fontAxisValueCount,
DWRITE_FONT_AXIS_RANGE const *fontAxisRanges,
UINT32 fontAxisRangeCount,
DWRITE_FONT_PROPERTY const *properties,
UINT32 propertyCount
);
Parameters
fontFile
Type: IDWriteFontFile*
Font file reference object to add to the set.
fontFaceIndex
Type: UINT32
The zero-based index of a font face in a collection.
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.
fontAxisRanges
Type: DWRITE_FONT_AXIS_RANGE const *
List of axis ranges.
fontAxisRangeCount
Type: UINT32
Number of axis ranges.
properties
Type: DWRITE_FONT_PROPERTY const *
List of properties to associate with the reference.
propertyCount
Type: UINT32
The number of properties defined.
Return value
Type: HRESULT
If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The font properties should include at least a family (typographic or weight/style/stretch). Otherwise the font would be accessible in the IDWriteFontSet only by index, not name.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 10 Build 16299 |
Minimum supported server | Windows 10 Build 16299 |
Target Platform | Windows |
Header | dwrite_3.h |
Library | Dwrite.lib |