IDWriteFactory::CreateFontFace method (dwrite.h)
Creates an object that represents a font face.
Syntax
HRESULT CreateFontFace(
DWRITE_FONT_FACE_TYPE fontFaceType,
UINT32 numberOfFiles,
[in] IDWriteFontFile * const *fontFiles,
UINT32 faceIndex,
DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,
[out] IDWriteFontFace **fontFace
);
Parameters
fontFaceType
Type: DWRITE_FONT_FACE_TYPE
A value that indicates the type of file format of the font face.
numberOfFiles
Type: UINT32
The number of font files, in element count, required to represent the font face.
[in] fontFiles
Type: const IDWriteFontFile*
A font file object representing the font face. Because IDWriteFontFace maintains its own references to the input font file objects, you may release them after this call.
faceIndex
Type: UINT32
The zero-based index of a font face, in cases when the font files contain a collection of font faces. If the font files contain a single face, this value should be zero.
fontFaceSimulationFlags
Type: DWRITE_FONT_SIMULATIONS
A value that indicates which, if any, font face simulation flags for algorithmic means of making text bold or italic are applied to the current font face.
[out] fontFace
Type: IDWriteFontFace**
When this method returns, contains an address of a pointer to the newly created font face object, or NULL in case of failure.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | dwrite.h |
Library | Dwrite.lib |
DLL | Dwrite.dll |