IDWriteFactory::CreateFontFileReference method (dwrite.h)

Creates a font file reference object from a local font file.

Syntax

HRESULT CreateFontFileReference(
  [in]           WCHAR const     *filePath,
  [in, optional] FILETIME const  *lastWriteTime,
  [out]          IDWriteFontFile **fontFile
);

Parameters

[in] filePath

Type: const WCHAR*

An array of characters that contains the absolute file path for the font file. Subsequent operations on the constructed object may fail if the user provided filePath doesn't correspond to a valid file on the disk.

[in, optional] lastWriteTime

Type: const FILETIME*

The last modified time of the input file path. If the parameter is omitted, the function will access the font file to obtain its last write time. You should specify this value to avoid extra disk access. Subsequent operations on the constructed object may fail if the user provided lastWriteTime doesn't match the file on the disk.

[out] fontFile

Type: IDWriteFontFile**

When this method returns, contains an address of a pointer to the newly created font file reference 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

See also

IDWriteFactory