IDWriteFontFace::TryGetFontTable Method
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
virtual HRESULT TryGetFontTable(
[in] UINT32 openTypeTableTag,
[out] const void ** tableData,
[out] UINT32 * tableSize,
[out] void ** tableContext,
[out] BOOL * exists
) = 0;
Parameter
openTypeTableTag [in]
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.tableData [out]
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.tableSize [out]
When this method returns, contains a pointer to the size, in bytes, of the font table.tableContext [out]
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.exists [out]
When this method returns, TRUE if the font table exists; otherwise, FALSE.
Rückgabewert
Ist Methode erfolgreich, wird "S_OK" zurückgegeben. Andernfalls wird ein HRESULT-Fehlercode zurückgegeben.
Hinweise
The context for the same tag may be different for each call, so each one must be held and released separately.
Anforderungen
Mindestens unterstützter Client |
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista |
Mindestens unterstützter Server |
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 |
Header |
Dwrite.h |
Bibliothek |
Dwrite.lib |
DLL |
Dwrite.dll |