IDWriteFontFace::TryGetFontTable method (dwrite.h)
Finds the specified OpenType font table if it exists and returns a pointer to it. The function accesses the underlying font data through the IDWriteFontFileStream interface implemented by the font file loader.
Syntax
HRESULT TryGetFontTable(
[in] UINT32 openTypeTableTag,
[out] const void **tableData,
[out] UINT32 *tableSize,
[out] void **tableContext,
[out] BOOL *exists
);
Parameters
[in] openTypeTableTag
Type: UINT32
The four-character tag of a OpenType font table to find. Use the DWRITE_MAKE_OPENTYPE_TAG macro to create it as an UINT32. Unlike GDI, it does not support the special TTCF and null tags to access the whole font.
[out] tableData
Type: const void**
When this method returns, contains the address of a pointer to the base of the table in memory. The pointer is valid only as long as the font face used to get the font table still exists; (not any other font face, even if it actually refers to the same physical font). This parameter is passed uninitialized.
[out] tableSize
Type: UINT32*
When this method returns, contains a pointer to the size, in bytes, of the font table.
[out] tableContext
Type: void**
When this method returns, the address of a pointer to the opaque context, which must be freed by calling ReleaseFontTable. The context actually comes from the lower-level IDWriteFontFileStream, which may be implemented by the application or DWrite itself. It is possible for a NULL tableContext to be returned, especially if the implementation performs direct memory mapping on the whole file. Nevertheless, always release it later, and do not use it as a test for function success. The same table can be queried multiple times, but because each returned context can be different, you must release each context separately.
[out] exists
Type: BOOL*
When this method returns, TRUE if the font table exists; otherwise, FALSE.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The context for the same tag may be different for each call, so each one must be held and released separately.
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 |