IDWriteInMemoryFontFileLoader::CreateInMemoryFontFileReference method (dwrite_3.h)

Creates a font file reference (IDWriteFontFile object) from an array of bytes. The font file reference is bound to the IDWriteInMemoryFontFileLoader instance with which it was created and remains valid for as long as that loader is registered with the factory.

Syntax

HRESULT CreateInMemoryFontFileReference(
                 IDWriteFactory  *factory,
  [in]           void const      *fontData,
                 UINT32          fontDataSize,
  [in, optional] IUnknown        *ownerObject,
  [out]          IDWriteFontFile **fontFile
);

Parameters

factory

Type: IDWriteFactory*

Factory object used to create the font file reference.

[in] fontData

Type: void const*

Pointer to a memory block containing the font data.

fontDataSize

Type: UINT32

Size of the font data.

[in, optional] ownerObject

Type: IUnknown*

Optional object that owns the memory specified by the fontData parameter. If this parameter is not NULL, the method stores a pointer to the font data and adds a reference to the owner object. The fontData pointer must remain valid until the owner object is released. If this parameter is NULL, the method makes a copy of the font data.

[out] fontFile

Type: IDWriteFontFile**

Receives a pointer to the newly-created font file reference.

Return value

Type: HRESULT

This method returns an HRESULT success or error code.

Requirements

Requirement Value
Target Platform Windows
Header dwrite_3.h
Library Dwrite.lib

See also

Creating a custom font set using font data loaded into memory

IDWriteInMemoryFontFileLoader