' ########################################################################################
' Microsoft Windows
' File: dwrite.inc
' Contents: DirectX Typography Services public API definitions.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
' Note: Do not include this file directly because d2d1.inc must be included first, but can't
' be done here. Include d2d1.inc instead.
#IF NOT %DEF(PBX_dwrite_PBI)
#DEFINE PBX_dwrite_PBI
%DWRITE_INC = 1
'#ifndef DWRITE_NO_WINDOWS_H
'#include <specstrings.h>
'#include <unknwn.h>
'#endif // DWRITE_NO_WINDOWS_H
#include once "dcommon.inc"
' enum DWRITE_FONT_FILE_TYPE
%DWRITE_FONT_FILE_TYPE_UNKNOWN = 0
%DWRITE_FONT_FILE_TYPE_CFF = 1
%DWRITE_FONT_FILE_TYPE_TRUETYPE = 2
%DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION = 3
%DWRITE_FONT_FILE_TYPE_TYPE1_PFM = 4
%DWRITE_FONT_FILE_TYPE_TYPE1_PFB = 5
%DWRITE_FONT_FILE_TYPE_VECTOR = 6
%DWRITE_FONT_FILE_TYPE_BITMAP = 7
' enum DWRITE_FONT_FACE_TYPE
%DWRITE_FONT_FACE_TYPE_CFF = 0
%DWRITE_FONT_FACE_TYPE_TRUETYPE = 1
%DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION = 2
%DWRITE_FONT_FACE_TYPE_TYPE1 = 3
%DWRITE_FONT_FACE_TYPE_VECTOR = 4
%DWRITE_FONT_FACE_TYPE_BITMAP = 5
%DWRITE_FONT_FACE_TYPE_UNKNOWN = 6
' enum DWRITE_FONT_SIMULATIONS
%DWRITE_FONT_SIMULATIONS_NONE = &H0000
%DWRITE_FONT_SIMULATIONS_BOLD = &H0001
%DWRITE_FONT_SIMULATIONS_OBLIQUE = &H0002
'#ifdef DEFINE_ENUM_FLAG_OPERATORS
'DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS);
'#endif
' enum DWRITE_FONT_WEIGHT
%DWRITE_FONT_WEIGHT_THIN = 100
%DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200
%DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200
%DWRITE_FONT_WEIGHT_LIGHT = 300
%DWRITE_FONT_WEIGHT_NORMAL = 400
%DWRITE_FONT_WEIGHT_REGULAR = 400
%DWRITE_FONT_WEIGHT_MEDIUM = 500
%DWRITE_FONT_WEIGHT_DEMI_BOLD = 600
%DWRITE_FONT_WEIGHT_SEMI_BOLD = 600
%DWRITE_FONT_WEIGHT_BOLD = 700
%DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800
%DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800
%DWRITE_FONT_WEIGHT_BLACK = 900
%DWRITE_FONT_WEIGHT_HEAVY = 900
%DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950
%DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950
' enum DWRITE_FONT_STRETCH
%DWRITE_FONT_STRETCH_UNDEFINED = 0
%DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1
%DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2
%DWRITE_FONT_STRETCH_CONDENSED = 3
%DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4
%DWRITE_FONT_STRETCH_NORMAL = 5
%DWRITE_FONT_STRETCH_MEDIUM = 5
%DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6
%DWRITE_FONT_STRETCH_EXPANDED = 7
%DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8
%DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
' enum DWRITE_FONT_STYLE
%DWRITE_FONT_STYLE_NORMAL = 0
%DWRITE_FONT_STYLE_OBLIQUE = 1
%DWRITE_FONT_STYLE_ITALIC = 2
' enum DWRITE_INFORMATIONAL_STRING_ID
%DWRITE_INFORMATIONAL_STRING_NONE = 0
%DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE = 1
%DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS = 2
%DWRITE_INFORMATIONAL_STRING_TRADEMARK = 3
%DWRITE_INFORMATIONAL_STRING_MANUFACTURER = 4
%DWRITE_INFORMATIONAL_STRING_DESIGNER = 5
%DWRITE_INFORMATIONAL_STRING_DESIGNER_URL = 6
%DWRITE_INFORMATIONAL_STRING_DESCRIPTION = 7
%DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL = 8
%DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION = 9
%DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL = 10
%DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES = 11
%DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES = 12
%DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES = 13
%DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES = 14
%DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT = 15
' // Size = 20 bytes
TYPE DWRITE_FONT_METRICS WORD
 designUnitsPerEm AS WORD ' UINT16
 ascent AS WORD ' UINT16
 descent AS WORD ' UINT16
 lineGap AS INTEGER ' INT16
 capHeight AS WORD ' UINT16
 xHeight AS WORD ' UINT16
 underlinePosition AS INTEGER ' INT16
 underlineThickness AS WORD ' UINT16
 strikethroughPosition AS INTEGER ' INT16
 strikethroughThickness AS WORD ' UINT16
END TYPE
' // Size = 28 bytes
TYPE DWRITE_GLYPH_METRICS DWORD
 leftSideBearing AS LONG ' INT32
 advanceWidth AS DWORD ' UINT32
 rightSideBearing AS LONG ' INT32
 topSideBearing AS LONG ' INT32
 advanceHeight AS DWORD ' UINT32
 bottomSideBearing AS LONG ' INT32
 verticalOriginY AS LONG ' INT32
END TYPE
' // Size = 8 bytes
TYPE DWRITE_GLYPH_OFFSET DWORD
 advanceOffset AS SINGLE ' FLOAT
 ascenderOffset AS SINGLE ' FLOAT
END TYPE
' enum DWRITE_FACTORY_TYPE
%DWRITE_FACTORY_TYPE_SHARED = 0
%DWRITE_FACTORY_TYPE_ISOLATED = 1
'// Creates an OpenType tag as a 32bit integer such that
'// the first character in the tag is the lowest byte,
'// (least significant on little endian architectures)
'// which can be used to compare with tags in the font file.
'// This macro is compatible with DWRITE_FONT_FEATURE_TAG.
'//
'// Example: DWRITE_MAKE_OPENTYPE_TAG('c','c','m','p')
'// Dword: 0x706D6363
'//
'#define DWRITE_MAKE_OPENTYPE_TAG(a,b,c,d) ( \
' (static_cast<UINT32>(static_cast<UINT8>(d)) << 24) | \
' (static_cast<UINT32>(static_cast<UINT8>(c)) << 16) | \
' (static_cast<UINT32>(static_cast<UINT8>(b)) << 8) | \
' static_cast<UINT32>(static_cast<UINT8>(a)))
FUNCTION DWRITE_MAKE_OPENTYPE_TAG (BYVAL a AS STRING, BYVAL b AS STRING, BYVAL c AS STRING, BYVAL d AS STRING) AS DWORD
 LOCAL cha AS DWORD, chb AS DWORD, chc AS DWORD, chd AS DWORD
 cha = ASC(a)
 chb = ASC(b)
 chc = ASC(c)
 chd = ASC(d)
 SHIFT LEFT chd, 24
 SHIFT LEFT chc, 16
 SHIFT LEFT chb, 8
 FUNCTION = chd OR chc OR chb OR cha
END FUNCTION
' ########################################################################################
' IDWriteFontFileLoader interface
' IID = 727cad4e-d6af-4c9e-8a08-d695b11caa49
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontFileLoader = GUID$("{727cad4e-d6af-4c9e-8a08-d695b11caa49}")
INTERFACE IDWriteFontFileLoader $IID_IDWriteFontFileLoader
 INHERIT IUnknown
 ' =====================================================================================
 METHOD CreateStreamFromKey ( ' VTable offset = 12
 BYREF fontFileReferenceKey AS DWORD
 , BYVAL fontFileReferenceKeySize AS DWORD
 , BYREF fontFileStream AS IDWriteFontFileStream
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteLocalFontFileLoader interface
' IID = b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2
' Inherited interface = IDWriteFontFileLoader
' ########################################################################################
$IID_IDWriteLocalFontFileLoader = GUID$("{b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2}")
INTERFACE IDWriteLocalFontFileLoader $IID_IDWriteLocalFontFileLoader
 INHERIT IUnknown
 ' =====================================================================================
 ' IDWriteFontFileLoader method
 ' =====================================================================================
 METHOD CreateStreamFromKey ( ' VTable offset = 12
 BYREF fontFileReferenceKey AS DWORD
 , BYVAL fontFileReferenceKeySize AS DWORD
 , BYREF fontFileStream AS IDWriteFontFileStream
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IDWriteLocalFontFileLoader methods
 ' =====================================================================================
 METHOD GetFilePathLengthFromKey ( ' VTable offset = 16
 BYREF fontFileReferenceKey AS DWORD
 , BYVAL fontFileReferenceKeySize AS DWORD
 , BYREF filePathLength AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetFilePathFromKey ( ' VTable offset = 20
 BYREF fontFileReferenceKey AS DWORD
 , BYVAL fontFileReferenceKeySize AS DWORD
 , BYREF filePath AS WSTRINGZ
 , BYVAL filePathSize AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetLastWriteTimeFromKey ( ' VTable offset = 24
 BYREF fontFileReferenceKey AS DWORD
 , BYVAL fontFileReferenceKeySize AS DWORD
 , BYREF lastWriteTime AS FILETIME
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFontFileStream interface
' IID = 6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontFileStream = GUID$("{6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0}")
INTERFACE IDWriteFontFileStream $IID_IDWriteFontFileStream
 INHERIT IUnknown
 ' =====================================================================================
 METHOD ReadFileFragment ( ' VTable offset = 12
 BYREF fragmentStart AS DWORD
 , BYVAL fileOffset AS QUAD
 , BYVAL fragmentSize AS QUAD
 , BYREF fragmentContext AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ReleaseFileFragment ( ' VTable offset = 16
 BYVAL fragmentContext AS DWORD
 ) ' void
 ' =====================================================================================
 METHOD GetFileSize ( ' VTable offset = 20
 BYREF fileSize AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD GetLastWriteTime ( ' VTable offset = 24
 BYREF lastWriteTime AS QUAD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFontFile interface
' IID = 739d886a-cef5-47dc-8769-1a8b41bebbb0
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontFile = GUID$("{739d886a-cef5-47dc-8769-1a8b41bebbb0}")
INTERFACE IDWriteFontFile $IID_IDWriteFontFile
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetReferenceKey ( ' VTable offset = 12
 BYREF fontFileReferenceKey AS DWORD
 , BYREF fontFileReferenceKeySize AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetLoader ( ' VTable offset = 16
 BYREF fontFileLoader AS IDWriteFontFileLoader
 ) AS LONG
 ' =====================================================================================
 METHOD Analyze ( ' VTable offset = 20
 BYREF isSupportedFontType AS LONG
 , BYREF fontFileType AS LONG
 , BYREF fontFaceType AS LONG
 , BYREF numberOfFaces AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#IF NOT %DEF(%DWRITE_PIXEL_GEOMETRY_DEFINED)
' enum DWRITE_PIXEL_GEOMETRY
%DWRITE_PIXEL_GEOMETRY_FLAT = 0
%DWRITE_PIXEL_GEOMETRY_RGB = 1
%DWRITE_PIXEL_GEOMETRY_BGR = 2
%DWRITE_PIXEL_GEOMETRY_DEFINED = 1
#ENDIF
' enum DWRITE_RENDERING_MODE
%DWRITE_RENDERING_MODE_DEFAULT = 0
%DWRITE_RENDERING_MODE_ALIASED = 1
%DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC = 2
%DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL = 3
%DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL = 4
%DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC = 5
%DWRITE_RENDERING_MODE_OUTLINE = 6
' // Size = 24 bytes
TYPE DWRITE_MATRIX DWORD
 m11 AS SINGLE ' FLOAT
 m12 AS SINGLE ' FLOAT
 m21 AS SINGLE ' FLOAT
 m22 AS SINGLE ' FLOAT
 dx AS SINGLE ' FLOAT
 dy AS SINGLE ' FLOAT
END TYPE
' ########################################################################################
' IDWriteRenderingParams interface
' IID = 2f0da53a-2add-47cd-82ee-d9ec34688e75
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteRenderingParams = GUID$("{2f0da53a-2add-47cd-82ee-d9ec34688e75}")
INTERFACE IDWriteRenderingParams $IID_IDWriteRenderingParams
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetGamma ( ' VTable offset = 12
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetEnhancedContrast ( ' VTable offset = 16
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetClearTypeLevel ( ' VTable offset = 20
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetPixelGeometry ( ' VTable offset = 24
 ) AS LONG ' DWRITE_PIXEL_GEOMETRY
 ' =====================================================================================
 METHOD GetRenderingMode ( ' VTable offset = 28
 ) AS LONG ' DWRITE_RENDERING_MODE
 ' =====================================================================================
END INTERFACE
'typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink;
MACRO IDWriteGeometrySink = ID2D1SimplifiedGeometrySink
' ########################################################################################
' IDWriteFontFace interface
' IID = 5f49804d-7024-4d43-bfa9-d25984f53849
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontFace = GUID$("{5f49804d-7024-4d43-bfa9-d25984f53849}")
INTERFACE IDWriteFontFace $IID_IDWriteFontFace
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetType ( ' VTable offset = 12
 ) AS LONG ' DWRITE_FONT_FACE_TYPE
 ' =====================================================================================
 METHOD GetFiles ( ' VTable offset = 16
 BYREF numberOfFiles AS DWORD
 , BYREF fontFiles AS IDWriteFontFile
 ) AS LONG
 ' =====================================================================================
 METHOD GetIndex ( ' VTable offset = 20
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetSimulations ( ' VTable offset = 24
 ) AS DWORD ' DWRITE_FONT_SIMULATIONS
 ' =====================================================================================
 METHOD IsSymbolFont ( ' VTable offset = 28
 ) AS LONG
 ' =====================================================================================
 METHOD GetMetrics ( ' VTable offset = 32
 BYREF fontFaceMetrics AS DWRITE_FONT_METRICS
 ) ' void
 ' =====================================================================================
 METHOD GetGlyphCount ( ' VTable offset = 36
 ) AS WORD ' UINT16
 ' =====================================================================================
 METHOD GetDesignGlyphMetrics ( ' VTable offset = 40
 BYREF glyphIndices AS WORD
 , BYVAL glyphCount AS DWORD
 , BYREF glyphMetrics AS DWRITE_GLYPH_METRICS
 , BYVAL isSideways AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetGlyphIndices ( ' VTable offset = 44
 BYREF codePoints AS DWORD
 , BYVAL codePointCount AS DWORD
 , BYREF glyphIndices AS WORD
 ) AS LONG
 ' =====================================================================================
 METHOD TryGetFontTable ( ' VTable offset = 48
 BYVAL openTypeTableTag AS DWORD
 , BYREF tableData AS DWORD
 , BYREF tableSize AS DWORD
 , BYREF tableContext AS DWORD
 , BYREF exists AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD ReleaseFontTable ( ' VTable offset = 52
 BYVAL tableContext AS DWORD
 ) ' void
 ' =====================================================================================
 METHOD GetGlyphRunOutline ( ' VTable offset = 56
 BYVAL emSize AS SINGLE
 , BYREF glyphIndices AS WORD
 , BYREF glyphAdvances AS SINGLE
 , BYREF glyphOffsets AS DWRITE_GLYPH_OFFSET
 , BYVAL glyphCount AS DWORD
 , BYVAL isSideways AS LONG
 , BYVAL isRightToLeft AS LONG
 , BYVAL geometrySink AS IDWriteGeometrySink
 ) AS LONG
 ' =====================================================================================
 METHOD GetRecommendedRenderingMode ( ' VTable offset = 60
 BYVAL emSize AS SINGLE
 , BYVAL pixelsPerDip AS SINGLE
 , BYVAL measuringMode AS LONG
 , BYVAL renderingParams AS IDWriteRenderingParams
 , BYREF renderingMode AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetGdiCompatibleMetrics ( ' VTable offset = 64
 BYVAL emSize AS SINGLE
 , BYVAL pixelsPerDip AS SINGLE
 , BYREF transform AS DWRITE_MATRIX
 , BYREF fontFaceMetrics AS DWRITE_FONT_METRICS
 ) AS LONG
 ' =====================================================================================
 METHOD GetGdiCompatibleGlyphMetrics ( ' VTable offset = 64
 BYVAL emSize AS SINGLE
 , BYVAL pixelsPerDip AS SINGLE
 , BYREF transform AS DWRITE_MATRIX
 , BYVAL useGdiNatural AS LONG
 , BYREF glyphIndices AS WORD
 , BYVAL glyphCount AS DWORD
 , BYREF glyphMetrics AS DWRITE_GLYPH_METRICS
 , BYVAL isSideways AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFontCollectionLoader interface
' IID = cca920e4-52f0-492b-bfa8-29c72ee0a468
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontCollectionLoader = GUID$("{cca920e4-52f0-492b-bfa8-29c72ee0a468}")
INTERFACE IDWriteFontCollectionLoader $IID_IDWriteFontCollectionLoader
 INHERIT IUnknown
 ' =====================================================================================
 METHOD CreateEnumeratorFromKey ( ' VTable offset = 12
 BYVAL factory AS IDWriteFactory
 , BYREF collectionKey AS DWORD
 , BYVAL collectionKeySize AS DWORD
 , BYREF fontFileEnumerator AS IDWriteFontFileEnumerator
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFontFileEnumerator interface
' IID = 72755049-5ff7-435d-8348-4be97cfa6c7c
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontFileEnumerator = GUID$("{72755049-5ff7-435d-8348-4be97cfa6c7c}")
INTERFACE IDWriteFontFileEnumerator $IID_IDWriteFontFileEnumerator
 INHERIT IUnknown
 ' =====================================================================================
 METHOD MoveNext ( ' VTable offset = 12
 BYREF hasCurrentFile AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetCurrentFontFile ( ' VTable offset = 16
 BYREF fontFile AS IDWriteFontFile
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteLocalizedStrings interface
' IID = 08256209-099a-4b34-b86d-c22b110e7771
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteLocalizedStrings = GUID$("{08256209-099a-4b34-b86d-c22b110e7771}")
INTERFACE IDWriteLocalizedStrings $IID_IDWriteLocalizedStrings
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetCount ( ' VTable offset = 12
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD FindLocaleName ( ' VTable offset = 16
 BYREF localeName AS WSTRINGZ
 , BYREF index AS DWORD
 , BYREF exists AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetLocaleNameLength ( ' VTable offset = 20
 BYVAL index AS DWORD
 , BYREF length AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetLocaleName ( ' VTable offset = 24
 BYVAL index AS DWORD
 , BYREF localeName AS WSTRINGZ
 , BYVAL size AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStringLength ( ' VTable offset = 28
 BYVAL index AS DWORD
 , BYREF length AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetString ( ' VTable offset = 32
 BYVAL index AS DWORD
 , BYREF stringBuffer AS WSTRINGZ
 , BYVAL size AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFontCollection interface
' IID = a84cee02-3eea-4eee-a827-87c1a02a0fcc
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontCollection = GUID$("{a84cee02-3eea-4eee-a827-87c1a02a0fcc}")
INTERFACE IDWriteFontCollection $IID_IDWriteFontCollection
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetFontFamilyCount ( ' VTable offset = 12
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetFontFamily ( ' VTable offset = 16
 BYVAL index AS DWORD
 , BYREF fontFamily AS IDWriteFontFamily
 ) AS LONG
 ' =====================================================================================
 METHOD FindFamilyName ( ' VTable offset = 20
 BYREF familyName AS WSTRINGZ
 , BYREF index AS DWORD
 , BYREF exists AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontFromFontFace ( ' VTable offset = 24
 BYVAL fontFace AS IDWriteFontFace
 , BYREF font AS IDWriteFont
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFontList interface
' IID = 1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFontList = GUID$("{1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb}")
INTERFACE IDWriteFontList $IID_IDWriteFontList
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetFontCollection ( ' VTable offset = 12
 BYREF fontCollection AS IDWriteFontCollection
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontCount ( ' VTable offset = 16
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetFont ( ' VTable offset = 20
 BYVAL index AS DWORD
 , BYREF font AS IDWriteFont
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFontFamily interface
' IID = da20d8ef-812a-4c43-9802-62ec4abd7add
' Inherited interface = IDWriteFontList
' ########################################################################################
$IID_IDWriteFontFamily = GUID$("{da20d8ef-812a-4c43-9802-62ec4abd7add}")
INTERFACE IDWriteFontFamily $IID_IDWriteFontFamily
 INHERIT IUnknown
 ' =====================================================================================
 ' IDWriteFontList methods
 ' =====================================================================================
 METHOD GetFontCollection ( ' VTable offset = 12
 BYREF fontCollection AS IDWriteFontCollection
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontCount ( ' VTable offset = 16
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetFont ( ' VTable offset = 20
 BYVAL index AS DWORD
 , BYREF font AS IDWriteFont
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IDWriteFontFamily methods
 ' =====================================================================================
 METHOD GetFamilyNames ( ' VTable offset = 24
 BYREF names AS IDWriteLocalizedStrings
 ) AS LONG
 ' =====================================================================================
 METHOD GetFirstMatchingFont ( ' VTable offset = 28
 BYVAL weight AS LONG
 , BYVAL stretch AS LONG
 , BYVAL style AS LONG
 , BYREF matchingFont AS IDWriteFont
 ) AS LONG
 ' =====================================================================================
 METHOD GetMatchingFonts ( ' VTable offset = 32
 BYVAL weight AS LONG
 , BYVAL stretch AS LONG
 , BYVAL style AS LONG
 , BYREF matchingFont AS IDWriteFontList
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFont interface
' IID = acd16696-8c14-4f5d-877e-fe3fc1d32737
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFont = GUID$("{acd16696-8c14-4f5d-877e-fe3fc1d32737}")
INTERFACE IDWriteFont $IID_IDWriteFont
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetFontFamily ( ' VTable offset = 12
 BYREF fontFamily AS IDWriteFontFamily
 ) AS LONG
 ' =====================================================================================
 METHOD GetWeight ( ' VTable offset = 16
 ) AS LONG ' DWRITE_FONT_WEIGHT
 ' =====================================================================================
 METHOD GetStretch ( ' VTable offset = 20
 ) AS LONG ' DWRITE_FONT_STRETCH
 ' =====================================================================================
 METHOD GetStyle ( ' VTable offset = 24
 ) AS LONG ' DWRITE_FONT_STYLE
 ' =====================================================================================
 METHOD IsSymbolFont ( ' VTable offset = 28
 ) AS LONG
 ' =====================================================================================
 METHOD GetFaceNames ( ' VTable offset = 32
 BYREF names AS IDWriteLocalizedStrings
 ) AS LONG
 ' =====================================================================================
 METHOD GetInformationalStrings ( ' VTable offset = 36
 BYVAL informationalStringID AS LONG
 , BYREF informationalStrings AS IDWriteLocalizedStrings
 , BYREF exists AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetSimulations ( ' VTable offset = 40
 ) AS DWORD ' DWRITE_FONT_SIMULATIONS
 ' =====================================================================================
 METHOD GetMetrics ( ' VTable offset = 44
 BYREF fontMetrics AS DWRITE_FONT_METRICS
 ) ' void
 ' =====================================================================================
 METHOD HasCharacter ( ' VTable offset = 48
 BYVAL unicodeValue AS DWORD
 , BYREF exists AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD CreateFontFace ( ' VTable offset = 52
 BYREF fontFace AS IDWriteFontFace
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' enum DWRITE_READING_DIRECTION
%DWRITE_READING_DIRECTION_LEFT_TO_RIGHT = 0
%DWRITE_READING_DIRECTION_RIGHT_TO_LEFT = 1
' enum DWRITE_FLOW_DIRECTION
%DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM = 0
' enum DWRITE_TEXT_ALIGNMENT
%DWRITE_TEXT_ALIGNMENT_LEADING = 0
%DWRITE_TEXT_ALIGNMENT_TRAILING = 1
%DWRITE_TEXT_ALIGNMENT_CENTER = 2
' enum DWRITE_PARAGRAPH_ALIGNMENT
%DWRITE_PARAGRAPH_ALIGNMENT_NEAR = 0
%DWRITE_PARAGRAPH_ALIGNMENT_FAR = 1
%DWRITE_PARAGRAPH_ALIGNMENT_CENTER = 2
' enum DWRITE_WORD_WRAPPING
%DWRITE_WORD_WRAPPING_WRAP = 0
%DWRITE_WORD_WRAPPING_NO_WRAP = 1
' enum DWRITE_LINE_SPACING_METHOD
%DWRITE_LINE_SPACING_METHOD_DEFAULT = 0
%DWRITE_LINE_SPACING_METHOD_UNIFORM = 1
' enum DWRITE_TRIMMING_GRANULARITY
%DWRITE_TRIMMING_GRANULARITY_NONE = 0
%DWRITE_TRIMMING_GRANULARITY_CHARACTER = 1
%DWRITE_TRIMMING_GRANULARITY_WORD = 2
' enum DWRITE_FONT_FEATURE_TAG
%DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = &H63726661 ' // 'afrc'
%DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = &H63703263 ' // 'c2pc'
%DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = &H63733263 ' // 'c2sc'
%DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = &H746c6163 ' // 'calt'
%DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = &H65736163 ' // 'case'
%DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = &H706d6363 ' // 'ccmp'
%DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = &H67696c63 ' // 'clig'
%DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = &H70737063 ' // 'cpsp'
%DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = &H68777363 ' // 'cswh'
%DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = &H73727563 ' // 'curs'
%DWRITE_FONT_FEATURE_TAG_DEFAULT = &H746c6664 ' // 'dflt'
%DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = &H67696c64 ' // 'dlig'
%DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = &H74707865 ' // 'expt'
%DWRITE_FONT_FEATURE_TAG_FRACTIONS = &H63617266 ' // 'frac'
%DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = &H64697766 ' // 'fwid'
%DWRITE_FONT_FEATURE_TAG_HALF_FORMS = &H666c6168 ' // 'half'
%DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = &H6e6c6168 ' // 'haln'
%DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = &H746c6168 ' // 'halt'
%DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = &H74736968 ' // 'hist'
%DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = &H616e6b68 ' // 'hkna'
%DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = &H67696c68 ' // 'hlig'
%DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = &H64697768 ' // 'hwid'
%DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = &H6f6a6f68 ' // 'hojo'
%DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = &H3430706a ' // 'jp04'
%DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = &H3837706a ' // 'jp78'
%DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = &H3338706a ' // 'jp83'
%DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = &H3039706a ' // 'jp90'
%DWRITE_FONT_FEATURE_TAG_KERNING = &H6e72656b ' // 'kern'
%DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = &H6167696c ' // 'liga'
%DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = &H6d756e6c ' // 'lnum'
%DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = &H6c636f6c ' // 'locl'
%DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = &H6b72616d ' // 'mark'
%DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = &H6b72676d ' // 'mgrk'
%DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = &H6b6d6b6d ' // 'mkmk'
%DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = &H746c616e ' // 'nalt'
%DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = &H6b636c6e ' // 'nlck'
%DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = &H6d756e6f ' // 'onum'
%DWRITE_FONT_FEATURE_TAG_ORDINALS = &H6e64726f ' // 'ordn'
%DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = &H746c6170 ' // 'palt'
%DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = &H70616370 ' // 'pcap'
%DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = &H6d756e70 ' // 'pnum'
%DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = &H64697770 ' // 'pwid'
%DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = &H64697771 ' // 'qwid'
%DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = &H67696c72 ' // 'rlig'
%DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = &H79627572 ' // 'ruby'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = &H746c6173 ' // 'salt'
%DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = &H666e6973 ' // 'sinf'
%DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = &H70636d73 ' // 'smcp'
%DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = &H6c706d73 ' // 'smpl'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = &H31307373 ' // 'ss01'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = &H32307373 ' // 'ss02'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = &H33307373 ' // 'ss03'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = &H34307373 ' // 'ss04'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = &H35307373 ' // 'ss05'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = &H36307373 ' // 'ss06'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = &H37307373 ' // 'ss07'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = &H38307373 ' // 'ss08'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = &H39307373 ' // 'ss09'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = &H30317373 ' // 'ss10'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = &H31317373 ' // 'ss11'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = &H32317373 ' // 'ss12'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = &H33317373 ' // 'ss13'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = &H34317373 ' // 'ss14'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = &H35317373 ' // 'ss15'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = &H36317373 ' // 'ss16'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = &H37317373 ' // 'ss17'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = &H38317373 ' // 'ss18'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = &H39317373 ' // 'ss19'
%DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = &H30327373 ' // 'ss20'
%DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = &H73627573 ' // 'subs'
%DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = &H73707573 ' // 'sups'
%DWRITE_FONT_FEATURE_TAG_SWASH = &H68737773 ' // 'swsh'
%DWRITE_FONT_FEATURE_TAG_TITLING = &H6c746974 ' // 'titl'
%DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = &H6d616e74 ' // 'tnam'
%DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = &H6d756e74 ' // 'tnum'
%DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = &H64617274 ' // 'trad'
%DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = &H64697774 ' // 'twid'
%DWRITE_FONT_FEATURE_TAG_UNICASE = &H63696e75 ' // 'unic'
%DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = &H6f72657a ' // 'zero'
' // Size = 8 bytes
TYPE DWRITE_TEXT_RANGE DWORD
 startPosition AS DWORD ' UINT32
 length AS DWORD ' UINT32
END TYPE
' // Size = 8 bytes
TYPE DWRITE_FONT_FEATURE DWORD
 nameTag AS DWORD ' DWRITE_FONT_FEATURE_TAG
 parameter AS DWORD ' UINT32
END TYPE
' // Size = 8 bytes
TYPE DWRITE_TYPOGRAPHIC_FEATURES DWORD
 features AS DWRITE_FONT_FEATURE PTR
 featureCount AS DWORD ' UINT32
END TYPE
' // Size = 12 bytes
TYPE DWRITE_TRIMMING DWORD
 granularity AS LONG ' DWRITE_TRIMMING_GRANULARITY
 delimiter AS DWORD ' UINT32
 delimiterCount AS DWORD ' UINT32
END TYPE
' ########################################################################################
' IDWriteTextFormat interface
' IID = 9c906818-31d7-4fd3-a151-7c5e225db55a
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteTextFormat = GUID$("{9c906818-31d7-4fd3-a151-7c5e225db55a}")
INTERFACE IDWriteTextFormat $IID_IDWriteTextFormat
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetTextAlignment ( ' VTable offset = 12
 BYVAL textAlignment AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetParagraphAlignment ( ' VTable offset = 16
 BYVAL paragraphAlignment AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetWordWrapping ( ' VTable offset = 20
 BYVAL wordWrapping AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetReadingDirection ( ' VTable offset = 24
 BYVAL readingDirection AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetFlowDirection ( ' VTable offset = 28
 BYVAL flowDirection AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetIncrementalTabStop ( ' VTable offset = 32
 BYVAL incrementalTabStop AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD SetTrimming ( ' VTable offset = 36
 BYREF trimmingOptions AS DWRITE_TRIMMING
 , BYVAL trimmingSign AS IDWriteInlineObject
 ) AS LONG
 ' =====================================================================================
 METHOD SetLineSpacing ( ' VTable offset = 40
 BYVAL lineSpacingMethod AS LONG
 , BYVAL lineSpacing AS SINGLE
 , BYVAL baseline AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetTextAlignment ( ' VTable offset = 44
 ) AS LONG ' DWRITE_TEXT_ALIGNMENT
 ' =====================================================================================
 METHOD GetParagraphAlignment ( ' VTable offset = 48
 ) AS LONG ' DWRITE_PARAGRAPH_ALIGNMENT
 ' =====================================================================================
 METHOD GetWordWrapping ( ' VTable offset = 52
 ) AS LONG ' DWRITE_WORD_WRAPPING
 ' =====================================================================================
 METHOD GetReadingDirection ( ' VTable offset = 56
 ) AS LONG ' DWRITE_READING_DIRECTION
 ' =====================================================================================
 METHOD GetFlowDirection ( ' VTable offset = 60
 ) AS LONG ' DWRITE_FLOW_DIRECTION
 ' =====================================================================================
 METHOD GetIncrementalTabStop ( ' VTable offset = 64
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetTrimming ( ' VTable offset = 68
 BYREF trimmingOptions AS LONG
 , BYREF trimmingSign AS IDWriteInlineObject
 ) AS LONG
 ' =====================================================================================
 METHOD GetLineSpacing ( ' VTable offset = 72
 BYREF lineSpacingMethod AS LONG
 , BYREF lineSpacing AS SINGLE
 , BYREF baseline AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontCollection ( ' VTable offset = 76
 BYREF fontCollection AS IDWriteFontCollection
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontFamilyNameLength ( ' VTable offset = 80
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetFontFamilyName ( ' VTable offset = 84
 BYREF fontFamilyName AS WSTRINGZ
 , BYVAL nameSize AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontWeight ( ' VTable offset = 88
 ) AS LONG ' DWRITE_FONT_WEIGHT
 ' =====================================================================================
 METHOD GetFontStyle ( ' VTable offset = 92
 ) AS LONG ' DWRITE_FONT_STYLE
 ' =====================================================================================
 METHOD GetFontStretch ( ' VTable offset = 96
 ) AS LONG ' DWRITE_FONT_STRETCH
 ' =====================================================================================
 METHOD GetFontSize ( ' VTable offset = 100
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetLocaleNameLength ( ' VTable offset = 104
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetLocaleName ( ' VTable offset = 108
 BYREF localeName AS WSTRINGZ
 , BYVAL nameSize AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteTypography interface
' IID = 55f1112b-1dc2-4b3c-9541-f46894ed85b6
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteTypography = GUID$("{55f1112b-1dc2-4b3c-9541-f46894ed85b6}")
INTERFACE IDWriteTypography $IID_IDWriteTypography
 INHERIT IUnknown
 ' =====================================================================================
 METHOD AddFontFeature ( ' VTable offset = 12
 BYVAL fontFeature AS DWRITE_FONT_FEATURE
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontFeatureCount ( ' VTable offset = 16
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetFontFeature ( ' VTable offset = 20
 BYVAL fontFeatureIndex AS DWORD
 , BYREF fontFeature AS DWRITE_FONT_FEATURE
 ) AS DWORD ' UINT32
 ' =====================================================================================
END INTERFACE
' enum DWRITE_SCRIPT_SHAPES
%DWRITE_SCRIPT_SHAPES_DEFAULT = 0&
%DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1&
'#ifdef DEFINE_ENUM_FLAG_OPERATORS
'DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES);
'#endif
' // Size = 8 bytes
TYPE DWRITE_SCRIPT_ANALYSIS DWORD FILL
 script AS WORD ' UINT16
 shapes AS LONG ' DWRITE_SCRIPT_SHAPES
END TYPE
' enum DWRITE_BREAK_CONDITION
%DWRITE_BREAK_CONDITION_NEUTRAL = 0
%DWRITE_BREAK_CONDITION_CAN_BREAK = 1
%DWRITE_BREAK_CONDITION_MAY_NOT_BREAK = 2
%DWRITE_BREAK_CONDITION_MUST_BREAK = 3
' // Size = 1 byte
TYPE DWRITE_LINE_BREAKPOINT BYTE
 breakConditionBefore AS BIT * 2 IN BYTE ' UINT8
 breakConditionAfter AS BIT * 2
 isWhitespace AS BIT * 1
 isSoftHyphen AS BIT * 1
 padding AS BIT * 2
END TYPE
' enum DWRITE_NUMBER_SUBSTITUTION_METHOD
%DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE = 0
%DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL = 1
%DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE = 2
%DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL = 3
%DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL = 4
' ########################################################################################
' IDWriteNumberSubstitution interface
' IID = 14885CC9-BAB0-4f90-B6ED-5C366A2CD03D
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteNumberSubstitution = GUID$("{14885CC9-BAB0-4f90-B6ED-5C366A2CD03D}")
INTERFACE IDWriteNumberSubstitution $IID_IDWriteNumberSubstitution
 INHERIT IUnknown
END INTERFACE
' // Size = 2 bytes
TYPE DWRITE_SHAPING_TEXT_PROPERTIES WORD
 isShapedAlone AS BIT * 1 IN WORD ' UINT16
 reserved AS BIT * 15
END TYPE
' // Size = 2 bytes
TYPE DWRITE_SHAPING_GLYPH_PROPERTIES WORD
 justification AS BIT * 4 IN WORD ' UINT16
 isClusterStart AS BIT * 1
 isDiacritic AS BIT * 1
 isZeroWidthSpace AS BIT * 1
 reserved AS BIT * 9
END TYPE
' ########################################################################################
' IDWriteTextAnalysisSource interface
' IID = 688e1a58-5094-47c8-adc8-fbcea60ae92b
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteTextAnalysisSource = GUID$("{688e1a58-5094-47c8-adc8-fbcea60ae92b}")
INTERFACE IDWriteTextAnalysisSource $IID_IDWriteTextAnalysisSource
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetTextAtPosition ( ' VTable offset = 12
 BYVAL textPosition AS DWORD
 , BYREF textString AS WSTRINGZ
 , BYREF textLength AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetTextBeforePosition ( ' VTable offset = 16
 BYVAL textPosition AS DWORD
 , BYREF textString AS WSTRINGZ
 , BYREF textLength AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetParagraphReadingDirection ( ' VTable offset = 20
 ) AS LONG ' DWRITE_READING_DIRECTION
 ' =====================================================================================
 METHOD GetLocaleName ( ' VTable offset = 24
 BYVAL textPosition AS DWORD
 , BYREF textLength AS DWORD
 , BYREF localeName AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD GetNumberSubstitution ( ' VTable offset = 28
 BYVAL textPosition AS DWORD
 , BYREF textLength AS DWORD
 , BYREF numberSubstitution AS IDWriteNumberSubstitution
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteTextAnalysisSink interface
' IID = 5810cd44-0ca0-4701-b3fa-bec5182ae4f6
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteTextAnalysisSink = GUID$("{5810cd44-0ca0-4701-b3fa-bec5182ae4f6}")
INTERFACE IDWriteTextAnalysisSink $IID_IDWriteTextAnalysisSink
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetScriptAnalysis ( ' VTable offset = 12
 BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYREF scriptAnalysis AS DWRITE_SCRIPT_ANALYSIS
 ) AS LONG
 ' =====================================================================================
 METHOD SetLineBreakpoints ( ' VTable offset = 16
 BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYREF lineBreakpoints AS DWRITE_LINE_BREAKPOINT
 ) AS LONG
 ' =====================================================================================
 METHOD SetBidiLevel ( ' VTable offset = 20
 BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYVAL explicitLevel AS WORD
 , BYVAL resolvedLevel AS WORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetNumberSubstitution ( ' VTable offset = 24
 BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYVAL numberSubstitution AS IDWriteNumberSubstitution
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteTextAnalyzer interface
' IID = b7e6163e-7f46-43b4-84b3-e4e6249c365d
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteTextAnalyzer = GUID$("{b7e6163e-7f46-43b4-84b3-e4e6249c365d}")
INTERFACE IDWriteTextAnalyzer $IID_IDWriteTextAnalyzer
 INHERIT IUnknown
 ' =====================================================================================
 METHOD AnalyzeScript ( ' VTable offset = 12
 BYVAL analysisSource AS IDWriteTextAnalysisSource
 , BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYVAL analysisSink AS IDWriteTextAnalysisSink
 ) AS LONG
 ' =====================================================================================
 METHOD AnalyzeBidi ( ' VTable offset = 16
 BYVAL analysisSource AS IDWriteTextAnalysisSource
 , BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYVAL analysisSink AS IDWriteTextAnalysisSink
 ) AS LONG
 ' =====================================================================================
 METHOD AnalyzeLineBreakpoints ( ' VTable offset = 20
 BYVAL analysisSource AS IDWriteTextAnalysisSource
 , BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYVAL analysisSink AS IDWriteTextAnalysisSink
 ) AS LONG
 ' =====================================================================================
 METHOD GetGlyphs ( ' VTable offset = 24
 BYREF textString AS WSTRINGZ
 , BYVAL textLength AS DWORD
 , BYVAL fontFace AS IDWriteFontFace
 , BYVAL isSideways AS LONG
 , BYVAL isRightToLeft AS LONG
 , BYREF scriptAnalysis AS DWRITE_SCRIPT_ANALYSIS
 , BYREF localeName AS WSTRINGZ
 , BYVAL numberSubstitution AS IDWriteNumberSubstitution
 , BYREF features AS DWRITE_TYPOGRAPHIC_FEATURES
 , BYREF featureRangeLengths AS DWORD
 , BYVAL featureRanges AS DWORD
 , BYVAL maxGlyphCount AS DWORD
 , BYREF clusterMap AS WORD
 , BYREF textProps AS DWRITE_SHAPING_TEXT_PROPERTIES
 , BYREF glyphIndices AS WORD
 , BYREF glyphProps AS DWRITE_SHAPING_GLYPH_PROPERTIES
 , BYREF actualGlyphCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetGlyphPlacements ( ' VTable offset = 28
 BYREF textString AS WSTRINGZ
 , BYREF clusterMap AS WORD
 , BYREF textProps AS DWRITE_SHAPING_TEXT_PROPERTIES
 , BYVAL textLength AS DWORD
 , BYREF glyphIndices AS WORD
 , BYREF glyphProps AS DWRITE_SHAPING_GLYPH_PROPERTIES
 , BYVAL glyphCount AS DWORD
 , BYVAL fontFace AS IDWriteFontFace
 , BYVAL fontEmSize AS SINGLE
 , BYVAL isSideways AS LONG
 , BYVAL isRightToLeft AS LONG
 , BYREF scriptAnalysis AS DWRITE_SCRIPT_ANALYSIS
 , BYREF localeName AS WSTRINGZ
 , BYREF features AS DWRITE_TYPOGRAPHIC_FEATURES
 , BYREF featureRangeLengths AS DWORD
 , BYVAL featureRanges AS DWORD
 , BYREF glyphAdvances AS SINGLE
 , BYREF glyphOffsets AS DWRITE_GLYPH_OFFSET
 ) AS LONG
 ' =====================================================================================
 METHOD GetGdiCompatibleGlyphPlacements ( ' VTable offset = 32
 BYREF textString AS WSTRINGZ
 , BYREF clusterMap AS WORD
 , BYREF textProps AS DWRITE_SHAPING_TEXT_PROPERTIES
 , BYVAL textLength AS DWORD
 , BYREF glyphIndices AS WORD
 , BYREF glyphProps AS DWRITE_SHAPING_GLYPH_PROPERTIES
 , BYVAL glyphCount AS DWORD
 , BYVAL fontFace AS IDWriteFontFace
 , BYVAL fontEmSize AS SINGLE
 , BYVAL pixelsPerDip AS SINGLE
 , BYREF transform AS DWRITE_MATRIX
 , BYVAL useGdiNatural AS LONG
 , BYVAL isSideways AS LONG
 , BYVAL isRightToLeft AS LONG
 , BYREF scriptAnalysis AS DWRITE_SCRIPT_ANALYSIS
 , BYREF localeName AS WSTRINGZ
 , BYREF features AS DWRITE_TYPOGRAPHIC_FEATURES
 , BYREF featureRangeLengths AS DWORD
 , BYVAL featureRanges AS DWORD
 , BYREF glyphAdvances AS SINGLE
 , BYREF glyphOffsets AS DWRITE_GLYPH_OFFSET
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' // Size = 32 bytes
TYPE DWRITE_GLYPH_RUN DWORD
 fontFace AS DWORD PTR
 fontEmSize AS SINGLE ' FLOAT
 glyphCount AS DWORD ' UINT32
 glyphIndices AS WORD PTR
 glyphAdvances AS SINGLE PTR
 glyphOffsets AS DWRITE_GLYPH_OFFSET PTR
 isSideways AS LONG
 bidiLevel AS DWORD ' UINT32
END TYPE
' // Size = 20 bytes
TYPE DWRITE_GLYPH_RUN_DESCRIPTION DWORD
 localeName AS WSTRINGZ PTR
 string AS WSTRINGZ PTR
 stringLength AS DWORD ' UINT32
 clusterMap AS WORD PTR
 textPosition AS DWORD ' UINT32
END TYPE
' // Size = 32 bytes
TYPE DWRITE_UNDERLINE DWORD
 width AS SINGLE ' FLOAT
 thickness AS SINGLE ' FLOAT
 offset AS SINGLE ' FLOAT
 runHeight AS SINGLE ' FLOAT
 readingDirection AS LONG ' DWRITE_READING_DIRECTION
 flowDirection AS LONG ' DWRITE_FLOW_DIRECTION
 localeName AS WSTRINGZ PTR
 measuringMode AS LONG ' DWRITE_MEASURING_MODE
END TYPE
' // Size = 28 bytes
TYPE DWRITE_STRIKETHROUGH DWORD
 width AS SINGLE ' FLOAT
 thickness AS SINGLE ' FLOAT
 offset AS SINGLE ' FLOAT
 readingDirection AS LONG ' DWRITE_READING_DIRECTION
 flowDirection AS LONG ' DWRITE_FLOW_DIRECTION
 localeName AS WSTRINGZ PTR
 measuringMode AS LONG ' DWRITE_MEASURING_MODE
END TYPE
' // Size = 24 bytes
TYPE DWRITE_LINE_METRICS DWORD
 length AS DWORD ' UINT32
 trailingWhitespaceLength AS DWORD ' UINT32
 newlineLength AS DWORD ' UINT32
 height AS SINGLE ' FLOAT
 baseline AS SINGLE ' FLOAT
 isTrimmed AS LONG
END TYPE
' // Size = 8 bytes
TYPE DWRITE_CLUSTER_METRICS WORD
 width AS SINGLE ' FLOAT
 length AS WORD ' UINT16
 canWrapLineAfter AS BIT * 1 IN WORD ' UINT16
 isWhitespace AS BIT * 1
 isNewline AS BIT * 1
 isSoftHyphen AS BIT * 1
 isRightToLeft AS BIT * 1
 padding AS BIT * 11
END TYPE
' // Size = 36 bytes
TYPE DWRITE_TEXT_METRICS DWORD
 left AS SINGLE ' FLOAT
 top AS SINGLE ' FLOAT
 width AS SINGLE ' FLOAT
 widthIncludingTrailingWhitespace AS SINGLE ' FLOAT
 height AS SINGLE ' FLOAT
 layoutWidth AS SINGLE ' FLOAT
 layoutHeight AS SINGLE ' FLOAT
 maxBidiReorderingDepth AS DWORD ' UINT32
 lineCount AS DWORD ' UINT32
END TYPE
' // Size = 16 bytes
TYPE DWRITE_INLINE_OBJECT_METRICS DWORD
 width AS SINGLE ' FLOAT
 height AS SINGLE ' FLOAT
 baseline AS SINGLE ' FLOAT
 supportsSideways AS LONG
END TYPE
' // Size = 16 bytes
TYPE DWRITE_OVERHANG_METRICS DWORD
 left AS SINGLE ' FLOAT
 top AS SINGLE ' FLOAT
 right AS SINGLE ' FLOAT
 bottom AS SINGLE ' FLOAT
END TYPE
' // Size = 36 bytes
TYPE DWRITE_HIT_TEST_METRICS DWORD
 textPosition AS DWORD ' UINT32
 length AS DWORD ' UINT32
 left AS SINGLE ' FLOAT
 top AS SINGLE ' FLOAT
 width AS SINGLE ' FLOAT
 height AS SINGLE ' FLOAT
 bidiLevel AS DWORD ' UINT32
 isText AS LONG
 isTrimmed AS LONG
END TYPE
' ########################################################################################
' IDWriteInlineObject interface
' IID = 8339FDE3-106F-47ab-8373-1C6295EB10B3
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteInlineObject = GUID$("{8339FDE3-106F-47ab-8373-1C6295EB10B3}")
INTERFACE IDWriteInlineObject $IID_IDWriteInlineObject
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Draw ( ' VTable offset = 12
 BYVAL clientDrawingContext AS DWORD
 , BYVAL renderer AS IDWriteTextRenderer
 , BYVAL originX AS SINGLE
 , BYVAL originY AS SINGLE
 , BYVAL isSideways AS LONG
 , BYVAL isRightToLeft AS LONG
 , BYVAL clientDrawingEffect AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD GetMetrics ( ' VTable offset = 16
 BYREF metrics AS DWRITE_INLINE_OBJECT_METRICS
 ) AS LONG
 ' =====================================================================================
 METHOD GetOverhangMetrics ( ' VTable offset = 20
 BYREF overhangs AS DWRITE_OVERHANG_METRICS
 ) AS LONG
 ' =====================================================================================
 METHOD GetBreakConditions ( ' VTable offset = 24
 BYREF breakConditionBefore AS LONG
 , BYREF breakConditionAfter AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWritePixelSnapping interface
' IID = eaf3a2da-ecf4-4d24-b644-b34f6842024b
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWritePixelSnapping = GUID$("{eaf3a2da-ecf4-4d24-b644-b34f6842024b}")
INTERFACE IDWritePixelSnapping $IID_IDWritePixelSnapping
 INHERIT IUnknown
 ' =====================================================================================
 METHOD IsPixelSnappingDisabled ( ' VTable offset = 12
 BYVAL clientDrawingContext AS DWORD
 , BYREF isDisabled AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetCurrentTransform ( ' VTable offset = 16
 BYVAL clientDrawingContext AS DWORD
 , BYREF transform AS DWRITE_MATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD GetPixelsPerDip ( ' VTable offset = 20
 BYVAL clientDrawingContext AS DWORD
 , BYREF pixelsPerDip AS SINGLE
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteTextRenderer interface
' IID = ef8a8135-5cc6-45fe-8825-c5a0724eb819
' Inherited interface = IDWritePixelSnapping
' ########################################################################################
$IID_IDWriteTextRenderer = GUID$("{ef8a8135-5cc6-45fe-8825-c5a0724eb819}")
INTERFACE IDWriteTextRenderer $IID_IDWriteTextRenderer
 INHERIT IUnknown
 ' =====================================================================================
 ' IDWritePixelSnapping methods
 ' =====================================================================================
 METHOD IsPixelSnappingDisabled ( ' VTable offset = 12
 BYVAL clientDrawingContext AS DWORD
 , BYREF isDisabled AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetCurrentTransform ( ' VTable offset = 16
 BYVAL clientDrawingContext AS DWORD
 , BYREF transform AS DWRITE_MATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD GetPixelsPerDip ( ' VTable offset = 20
 BYVAL clientDrawingContext AS DWORD
 , BYREF pixelsPerDip AS SINGLE
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IDWriteTextRenderer methods
 ' =====================================================================================
 METHOD DrawGlyphRun ( ' VTable offset = 24
 BYVAL clientDrawingContext AS DWORD
 , BYVAL baselineOriginX AS SINGLE
 , BYVAL baselineOriginY AS SINGLE
 , BYVAL measuringMode AS LONG
 , BYREF glyphRun AS DWRITE_GLYPH_RUN
 , BYREF glyphRunDescription AS DWRITE_GLYPH_RUN_DESCRIPTION
 , BYVAL clientDrawingEffect AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD DrawUnderline ( ' VTable offset = 28
 BYVAL clientDrawingContext AS DWORD
 , BYVAL baselineOriginX AS SINGLE
 , BYVAL baselineOriginY AS SINGLE
 , BYREF underline AS DWRITE_UNDERLINE
 , BYVAL clientDrawingEffect AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD DrawStrikethrough ( ' VTable offset = 32
 BYVAL clientDrawingContext AS DWORD
 , BYVAL baselineOriginX AS SINGLE
 , BYVAL baselineOriginY AS SINGLE
 , BYREF strikethrough AS DWRITE_STRIKETHROUGH
 , BYVAL clientDrawingEffect AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD DrawInlineObject ( ' VTable offset = 36
 BYVAL clientDrawingContext AS DWORD
 , BYVAL originX AS SINGLE
 , BYVAL originY AS SINGLE
 , BYVAL inlineObject AS IDWriteInlineObject
 , BYVAL isSideways AS LONG
 , BYVAL isRightToLeft AS LONG
 , BYVAL clientDrawingEffect AS IUnknown
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteTextLayout interface
' IID = 53737037-6d14-410b-9bfe-0b182bb70961
' Inherited interface = IDWriteTextFormat
' ########################################################################################
$IID_IDWriteTextLayout = GUID$("{53737037-6d14-410b-9bfe-0b182bb70961}")
INTERFACE IDWriteTextLayout $IID_IDWriteTextLayout
 INHERIT IUnknown
 ' =====================================================================================
 ' IDWriteTextFormat methods
 ' =====================================================================================
 METHOD SetTextAlignment ( ' VTable offset = 12
 BYVAL textAlignment AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetParagraphAlignment ( ' VTable offset = 16
 BYVAL paragraphAlignment AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetWordWrapping ( ' VTable offset = 20
 BYVAL wordWrapping AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetReadingDirection ( ' VTable offset = 24
 BYVAL readingDirection AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetFlowDirection ( ' VTable offset = 28
 BYVAL flowDirection AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetIncrementalTabStop ( ' VTable offset = 32
 BYVAL incrementalTabStop AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD SetTrimming ( ' VTable offset = 36
 BYREF trimmingOptions AS DWRITE_TRIMMING
 , BYVAL trimmingSign AS IDWriteInlineObject
 ) AS LONG
 ' =====================================================================================
 METHOD SetLineSpacing ( ' VTable offset = 40
 BYVAL lineSpacingMethod AS LONG
 , BYVAL lineSpacing AS SINGLE
 , BYVAL baseline AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetTextAlignment ( ' VTable offset = 44
 ) AS LONG ' DWRITE_TEXT_ALIGNMENT
 ' =====================================================================================
 METHOD GetParagraphAlignment ( ' VTable offset = 48
 ) AS LONG ' DWRITE_PARAGRAPH_ALIGNMENT
 ' =====================================================================================
 METHOD GetWordWrapping ( ' VTable offset = 52
 ) AS LONG ' DWRITE_WORD_WRAPPING
 ' =====================================================================================
 METHOD GetReadingDirection ( ' VTable offset = 56
 ) AS LONG ' DWRITE_READING_DIRECTION
 ' =====================================================================================
 METHOD GetFlowDirection ( ' VTable offset = 60
 ) AS LONG ' DWRITE_FLOW_DIRECTION
 ' =====================================================================================
 METHOD GetIncrementalTabStop ( ' VTable offset = 64
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetTrimming ( ' VTable offset = 68
 BYREF trimmingOptions AS LONG
 , BYREF trimmingSign AS IDWriteInlineObject
 ) AS LONG
 ' =====================================================================================
 METHOD GetLineSpacing ( ' VTable offset = 72
 BYREF lineSpacingMethod AS LONG
 , BYREF lineSpacing AS SINGLE
 , BYREF baseline AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontCollection ( ' VTable offset = 76
 BYREF fontCollection AS IDWriteFontCollection
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontFamilyNameLength ( ' VTable offset = 80
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetFontFamilyName ( ' VTable offset = 84
 BYREF fontFamilyName AS WSTRINGZ
 , BYVAL nameSize AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetFontWeight ( ' VTable offset = 88
 ) AS LONG ' DWRITE_FONT_WEIGHT
 ' =====================================================================================
 METHOD GetFontStyle ( ' VTable offset = 92
 ) AS LONG ' DWRITE_FONT_STYLE
 ' =====================================================================================
 METHOD GetFontStretch ( ' VTable offset = 96
 ) AS LONG ' DWRITE_FONT_STRETCH
 ' =====================================================================================
 METHOD GetFontSize ( ' VTable offset = 100
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetLocaleNameLength ( ' VTable offset = 104
 ) AS DWORD ' UINT32
 ' =====================================================================================
 METHOD GetLocaleName ( ' VTable offset = 108
 BYREF localeName AS WSTRINGZ
 , BYVAL nameSize AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IDWriteTextLayout methods
 ' =====================================================================================
 METHOD SetMaxWidth ( ' VTable offset = 112
 BYVAL maxWidth AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD SetMaxHeight ( ' VTable offset = 116
 BYVAL maxHeight AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD SetFontCollection ( ' VTable offset = 120
 BYVAL fontCollection AS IDWriteFontCollection
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetFontFamilyName ( ' VTable offset = 124
 BYREF fontFamilyName AS WSTRINGZ
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetFontWeight ( ' VTable offset = 128
 BYVAL fontWeight AS LONG
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetFontStyle ( ' VTable offset = 132
 BYVAL fontStyle AS LONG
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetFontStretch ( ' VTable offset = 136
 BYVAL fontStretch AS LONG
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetFontSize ( ' VTable offset = 140
 BYVAL fontSize AS SINGLE
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetUnderline ( ' VTable offset = 144
 BYVAL hasUnderline AS LONG
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetStrikethrough ( ' VTable offset = 148
 BYVAL hasStrikethrough AS LONG
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetDrawingEffect ( ' VTable offset = 152
 BYVAL drawingEffect AS IUnknown
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetInlineObject ( ' VTable offset = 156
 BYVAL inlineObject AS IDWriteInlineObject
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetTypography ( ' VTable offset = 160
 BYVAL typography AS IDWriteTypography
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD SetLocaleName ( ' VTable offset = 164
 BYREF localeName AS WSTRINGZ
 , BYVAL textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD GetMaxWidth ( ' VTable offset = 168
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD GetMaxHeight ( ' VTable offset = 172
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetFontCollection.
 ' =====================================================================================
 METHOD GetFontCollection_ ( ' VTable offset = 176
 BYVAL currentPosition AS DWORD
 , BYREF fontCollection AS IDWriteFontCollection
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetFontFamilyNameLength
 ' =====================================================================================
 METHOD GetFontFamilyNameLength_ ( ' VTable offset = 180
 BYVAL currentPosition AS DWORD
 , BYREF nameLength AS DWORD
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetFontFamilyName
 ' =====================================================================================
 METHOD GetFontFamilyName_ ( ' VTable offset = 184
 BYVAL currentPosition AS DWORD
 , BYREF fontFamilyName AS WSTRINGZ
 , BYVAL nameSize AS DWORD
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetFontWeight
 ' =====================================================================================
 METHOD GetFontWeight_ ( ' VTable offset = 188
 BYVAL currentPosition AS DWORD
 , BYREF fontWeight AS LONG
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetFontStyle
 ' =====================================================================================
 METHOD GetFontStyle_ ( ' VTable offset = 192
 BYVAL currentPosition AS DWORD
 , BYREF fontStyle AS LONG
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetFontStretch
 ' =====================================================================================
 METHOD GetFontStretch_ ( ' VTable offset = 196
 BYVAL currentPosition AS DWORD
 , BYREF fontStretch AS LONG
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetFontSize
 ' =====================================================================================
 METHOD GetFontSize_ ( ' VTable offset = 200
 BYVAL currentPosition AS DWORD
 , BYREF fontSize AS SINGLE
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD GetUnderline ( ' VTable offset = 204
 BYVAL currentPosition AS DWORD
 , BYREF hasUnderline AS LONG
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD GetStrikethrough ( ' VTable offset = 208
 BYVAL currentPosition AS DWORD
 , BYREF hasStrikethrough AS LONG
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD GetDrawingEffect ( ' VTable offset = 212
 BYVAL currentPosition AS DWORD
 , BYREF drawingEffect AS IUnknown
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD GetInlineObject ( ' VTable offset = 216
 BYVAL currentPosition AS DWORD
 , BYREF inlineObject AS IDWriteInlineObject
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD GetTypography ( ' VTable offset = 220
 BYVAL currentPosition AS DWORD
 , BYREF typography AS IDWriteTypography
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetLocaleNameLength
 ' =====================================================================================
 METHOD GetLocaleNameLength_ ( ' VTable offset = 224
 BYVAL currentPosition AS DWORD
 , BYREF nameLength AS DWORD
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 ' In the inherited IDWriteTextFormat interface there is already a method called GetLocaleName
 ' =====================================================================================
 METHOD GetLocaleName_ ( ' VTable offset = 228
 BYVAL currentPosition AS DWORD
 , BYREF localName AS WSTRINGZ
 , BYVAL nameSize AS DWORD
 , OPTIONAL BYREF textRange AS DWRITE_TEXT_RANGE
 ) AS LONG
 ' =====================================================================================
 METHOD Draw ( ' VTable offset = 232
 BYVAL clientDrawingContext AS DWORD
 , BYVAL renderer AS IDWriteTextRenderer
 , BYVAL originX AS SINGLE
 , BYVAL originY AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetLineMetrics ( ' VTable offset = 236
 BYREF lineMetrics AS DWRITE_LINE_METRICS
 , BYVAL maxLineCount AS DWORD
 , BYREF actualLineCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMetrics ( ' VTable offset = 240
 BYREF textMetrics AS DWRITE_TEXT_METRICS
 ) AS LONG
 ' =====================================================================================
 METHOD GetOverhangMetrics ( ' VTable offset = 244
 BYREF overhangs AS DWRITE_OVERHANG_METRICS
 ) AS LONG
 ' =====================================================================================
 METHOD GetClusterMetrics ( ' VTable offset = 248
 BYREF clusterMetrics AS DWRITE_CLUSTER_METRICS
 , BYVAL maxClusterCount AS DWORD
 , BYREF actualClusterCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DetermineMinWidth ( ' VTable offset = 252
 BYREF minWidth AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD HitTestPoint ( ' VTable offset = 256
 BYVAL pointX AS SINGLE
 , BYVAL pointY AS SINGLE
 , BYREF isTrailingHit AS LONG
 , BYREF isInside AS LONG
 , BYREF hitTestMetrics AS DWRITE_HIT_TEST_METRICS
 ) AS LONG
 ' =====================================================================================
 METHOD HitTestTextPosition ( ' VTable offset = 260
 BYVAL textPosition AS DWORD
 , BYVAL isTrailingHit AS LONG
 , BYREF pointX AS SINGLE
 , BYREF pointY AS SINGLE
 , BYREF hitTestMetrics AS DWRITE_HIT_TEST_METRICS
 ) AS LONG
 ' =====================================================================================
 METHOD HitTestTextRange ( ' VTable offset = 264
 BYVAL textPosition AS DWORD
 , BYVAL textLength AS DWORD
 , BYVAL originX AS SINGLE
 , BYVAL originY AS SINGLE
 , BYREF hitTestMetrics AS DWRITE_HIT_TEST_METRICS
 , BYVAL maxHitTestMetricsCount AS DWORD
 , BYREF actualHitTestMetricsCount AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteBitmapRenderTarget interface
' IID = 5e5a32a3-8dff-4773-9ff6-0696eab77267
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteBitmapRenderTarget = GUID$("{5e5a32a3-8dff-4773-9ff6-0696eab77267}")
INTERFACE IDWriteBitmapRenderTarget $IID_IDWriteBitmapRenderTarget
 INHERIT IUnknown
 ' =====================================================================================
 METHOD DrawGlyphRun ( ' VTable offset = 12
 BYVAL baselineOriginX AS SINGLE
 , BYVAL baselineOriginY AS SINGLE
 , BYVAL measuringMode AS LONG
 , BYREF glyphRun AS DWRITE_GLYPH_RUN
 , BYVAL renderingParams AS IDWriteRenderingParams
 , BYVAL textColor AS DWORD
 , OPTIONAL BYREF blackBoxRect AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD GetMemoryDC ( ' VTable offset = 16
 ) AS DWORD ' HDC
 ' =====================================================================================
 METHOD GetPixelsPerDip ( ' VTable offset = 20
 ) AS SINGLE ' FLOAT
 ' =====================================================================================
 METHOD SetPixelsPerDip ( ' VTable offset = 24
 BYVAL pixelsPerDip AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetCurrentTransform ( ' VTable offset = 28
 BYREF transform AS DWRITE_MATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD SetCurrentTransform ( ' VTable offset = 32
 OPTIONAL BYREF transform AS DWRITE_MATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD GetSize ( ' VTable offset = 36
 BYREF size AS SIZE
 ) AS LONG
 ' =====================================================================================
 METHOD Resize ( ' VTable offset = 40
 BYVAL width AS DWORD
 , BYVAL height AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteGdiInterop interface
' IID = 1edd9491-9853-4299-898f-6432983b6f3a
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteGdiInterop = GUID$("{1edd9491-9853-4299-898f-6432983b6f3a}")
INTERFACE IDWriteGdiInterop $IID_IDWriteGdiInterop
 INHERIT IUnknown
 ' =====================================================================================
 METHOD CreateFontFromLOGFONT ( ' VTable offset = 12
 BYREF logFont AS LOGFONTW
 , BYREF font AS IDWriteFont
 ) AS LONG
 ' =====================================================================================
 METHOD ConvertFontToLOGFONT ( ' VTable offset = 16
 BYVAL font AS IDWriteFont
 , BYREF logFont AS LOGFONTW
 , BYREF isSystemFont AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD ConvertFontFaceToLOGFONT ( ' VTable offset = 20
 BYVAL font AS IDWriteFontFace
 , BYREF logFont AS LOGFONTW
 ) AS LONG
 ' =====================================================================================
 METHOD CreateFontFaceFromHdc ( ' VTable offset = 24
 BYVAL hdc AS DWORD
 , BYREF fontFace AS IDWriteFontFace
 ) AS LONG
 ' =====================================================================================
 METHOD CreateBitmapRenderTarget ( ' VTable offset = 28
 BYVAL hdc AS DWORD
 , BYVAL width AS DWORD
 , BYVAL height AS DWORD
 , BYREF renderTarget AS IDWriteBitmapRenderTarget
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' enum DWRITE_TEXTURE_TYPE
%DWRITE_TEXTURE_ALIASED_1x1 = 0
%DWRITE_TEXTURE_CLEARTYPE_3x1 = 1
%DWRITE_ALPHA_MAX = 255
' ########################################################################################
' IDWriteGlyphRunAnalysis interface
' IID = 7d97dbf7-e085-42d4-81e3-6a883bded118
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteGlyphRunAnalysis = GUID$("{7d97dbf7-e085-42d4-81e3-6a883bded118}")
INTERFACE IDWriteGlyphRunAnalysis $IID_IDWriteGlyphRunAnalysis
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetAlphaTextureBounds ( ' VTable offset = 12
 BYVAL textureType AS LONG
 , BYREF textureBounds AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD CreateAlphaTexture ( ' VTable offset = 16
 BYVAL textureType AS LONG
 , BYREF textureBounds AS RECT
 , BYREF alphaValues AS BYTE
 , BYVAL bufferSize AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetAlphaBlendParams ( ' VTable offset = 20
 BYVAL renderingParams AS IDWriteRenderingParams
 , BYREF blendGamma AS SINGLE
 , BYREF blendEnhancedContrast AS SINGLE
 , BYREF blendClearTypeLevel AS SINGLE
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' IDWriteFactory interface
' IID = b859ee5a-d838-4b5b-a2e8-1adc7d93db48
' Inherited interface = IUnknown
' ########################################################################################
$IID_IDWriteFactory = GUID$("{b859ee5a-d838-4b5b-a2e8-1adc7d93db48}")
INTERFACE IDWriteFactory $IID_IDWriteFactory
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetSystemFontCollection ( ' VTable offset = 12
 BYREF fontCollection AS IDWriteFontCollection
 , BYVAL checkForUpdates AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD CreateCustomFontCollection ( ' VTable offset = 16
 BYVAL collectionLoader AS IDWriteFontCollectionLoader
 , BYREF collectionKey AS DWORD
 , BYVAL collectionKeySize AS DWORD
 , BYREF fontCollection AS IDWriteFontCollection
 ) AS LONG
 ' =====================================================================================
 METHOD RegisterFontCollectionLoader ( ' VTable offset = 20
 BYVAL fontCollectionLoader AS IDWriteFontCollectionLoader
 ) AS LONG
 ' =====================================================================================
 METHOD UnregisterFontCollectionLoader ( ' VTable offset = 24
 BYVAL fontCollectionLoader AS IDWriteFontCollectionLoader
 ) AS LONG
 ' =====================================================================================
 METHOD CreateFontFileReference ( ' VTable offset = 28
 BYREF filePath AS WSTRINGZ
 , BYREF lastWriteTime AS FILETIME
 , BYREF fontFile AS IDWriteFontFile
 ) AS LONG
 ' =====================================================================================
 METHOD CreateCustomFontFileReference ( ' VTable offset = 32
 BYREF fontFileReferenceKey AS DWORD
 , BYVAL fontFileReferenceKeySize AS DWORD
 , BYVAL fontFileLoader AS IDWriteFontFileLoader
 , BYREF fontFile AS IDWriteFontFile
 ) AS LONG
 ' =====================================================================================
 METHOD CreateFontFace ( ' VTable offset = 36
 BYVAL fontFaceType AS LONG
 , BYVAL numberOfFiles AS DWORD
 , BYREF fontFiles AS IDWriteFontFile
 , BYVAL faceIndex AS DWORD
 , BYVAL fontFaceSimulationFlags AS DWORD
 , BYREF fontFace AS IDWriteFontFace
 ) AS LONG
 ' =====================================================================================
 METHOD CreateRenderingParams ( ' VTable offset = 40
 BYREF renderingParams AS IDWriteRenderingParams
 ) AS LONG
 ' =====================================================================================
 METHOD CreateMonitorRenderingParams ( ' VTable offset = 44
 BYVAL monitor AS DWORD
 , BYREF renderingParams AS IDWriteRenderingParams
 ) AS LONG
 ' =====================================================================================
 METHOD CreateCustomRenderingParams ( ' VTable offset = 48
 BYVAL gamma AS SINGLE
 , BYVAL enhancedContrast AS SINGLE
 , BYVAL clearTypeLevel AS SINGLE
 , BYVAL pixelGeometry AS LONG
 , BYVAL renderingMode AS LONG
 , BYREF renderingParams AS IDWriteRenderingParams
 ) AS LONG
 ' =====================================================================================
 METHOD RegisterFontFileLoader ( ' VTable offset = 52
 BYVAL fontFileLoader AS IDWriteFontFileLoader
 ) AS LONG
 ' =====================================================================================
 METHOD UnregisterFontFileLoader ( ' VTable offset = 56
 BYVAL fontFileLoader AS IDWriteFontFileLoader
 ) AS LONG
 ' =====================================================================================
 METHOD CreateTextFormat ( ' VTable offset = 60
 BYREF fontFamilyName AS WSTRINGZ
 , BYVAL fontCollection AS IDWriteFontCollection
 , BYVAL fontWeight AS LONG
 , BYVAL fontStyle AS LONG
 , BYVAL fontStretch AS LONG
 , BYVAL fontSize AS SINGLE
 , BYREF localeName AS WSTRINGZ
 , BYREF textFormat AS IDWriteTextFormat
 ) AS LONG
 ' =====================================================================================
 METHOD CreateTypography ( ' VTable offset = 64
 BYREF typography AS IDWriteTypography
 ) AS LONG
 ' =====================================================================================
 METHOD GetGdiInterop ( ' VTable offset = 68
 BYREF gdiInterop AS IDWriteGdiInterop
 ) AS LONG
 ' =====================================================================================
 METHOD CreateTextLayout ( ' VTable offset = 72
 BYREF string AS WSTRINGZ
 , BYVAL stringLength AS DWORD
 , BYVAL textFormat AS IDWriteTextFormat
 , BYVAL maxWidth AS SINGLE
 , BYVAL maxHeight AS SINGLE
 , BYREF textLayout AS IDWriteTextLayout
 ) AS LONG
 ' =====================================================================================
 METHOD CreateGdiCompatibleTextLayout ( ' VTable offset = 76
 BYREF string AS WSTRINGZ
 , BYVAL stringLength AS DWORD
 , BYVAL textFormat AS IDWriteTextFormat
 , BYVAL layoutWidth AS SINGLE
 , BYVAL layoutHeight AS SINGLE
 , BYVAL pixelsPerDip AS SINGLE
 , BYREF transform AS DWRITE_MATRIX
 , BYVAL useGdiNatural AS LONG
 , BYREF textLayout AS IDWriteTextLayout
 ) AS LONG
 ' =====================================================================================
 METHOD CreateEllipsisTrimmingSign ( ' VTable offset = 80
 BYVAL textFormat AS IDWriteTextFormat
 , BYREF trimmingSign AS IDWriteInlineObject
 ) AS LONG
 ' =====================================================================================
 METHOD CreateTextAnalyzer ( ' VTable offset = 84
 BYREF textAnalyzer AS IDWriteTextAnalyzer
 ) AS LONG
 ' =====================================================================================
 METHOD CreateNumberSubstitution ( ' VTable offset = 88
 BYVAL substitutionMethod AS LONG
 , BYREF localeName AS WSTRINGZ
 , BYVAL ignoreUserOverride AS LONG
 , BYREF numberSubstitution AS IDWriteNumberSubstitution
 ) AS LONG
 ' =====================================================================================
 METHOD CreateGlyphRunAnalysis ( ' VTable offset = 92
 BYREF glyphRun AS DWRITE_GLYPH_RUN
 , BYVAL pixelsPerDip AS SINGLE
 , BYREF transform AS DWRITE_MATRIX
 , BYVAL renderingMode AS LONG
 , BYVAL measuringMode AS LONG
 , BYVAL baselineOriginX AS SINGLE
 , BYVAL baselineOriginY AS SINGLE
 , BYREF glyphRunAnalysis AS IDWriteGlyphRunAnalysis
 ) AS LONG
 ' =====================================================================================
END INTERFACE
DECLARE FUNCTION DWriteCreateFactory LIB "dwrite.dll" ALIAS "DWriteCreateFactory" ( BYVAL factoryType AS LONG , BYREF iid AS GUID , BYREF factory AS IUnknown ) AS LONG
'// Macros used to define DirectWrite error codes.
'#define FACILITY_DWRITE 0x898
'#define DWRITE_ERR_BASE 0x5000
'#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code))
'#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)
%FACILITY_DWRITE = &H898
%DWRITE_ERR_BASE = &H5000
MACRO MAKE_DWRITE_HR (severity, code) = MAKE_HRESULT(severity, %FACILITY_DWRITE, %DWRITE_ERR_BASE + code)
MACRO MAKE_DWRITE_HR_ERR (code) = MAKE_DWRITE_HR(%SEVERITY_ERROR, code)
'// Indicates an error in an input file such as a font file.
'#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000)
%DWRITE_E_FILEFORMAT = &H88985000&
'// Indicates an error originating in DirectWrite code, which is not expected to occur but is safe to recover from.
'#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001)
%DWRITE_E_UNEXPECTED = &H88985001&
'// Indicates the specified font does not exist.
'#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002)
%DWRITE_E_NOFONT = &H88985002&
'// A font file could not be opened because the file, directory, network location, drive, or other storage
'// location does not exist or is unavailable.
'#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003)
%DWRITE_E_FILENOTFOUND = &H88985003&
'// A font file exists but could not be opened due to access denied, sharing violation, or similar error.
'#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004)
%DWRITE_E_FILEACCESS = &H88985004&
'// A font collection is obsolete due to changes in the system.
'#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005)
%DWRITE_E_FONTCOLLECTIONOBSOLETE = &H88985005&
'// The given interface is already registered.
'#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006)
%DWRITE_E_ALREADYREGISTERED = &H88985006&