1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! DirectX Typography Services public API definitions.
8 use shared
::basetsd
::{INT16, INT32, UINT16, UINT32, UINT64, UINT8}
;
9 use shared
::guiddef
::REFIID
;
10 use shared
::minwindef
::{BOOL, BYTE, FILETIME, FLOAT}
;
11 use shared
::windef
::{COLORREF, HDC, HMONITOR, RECT, SIZE}
;
12 use shared
::winerror
::SEVERITY_ERROR
;
13 use um
::d2d1
::ID2D1SimplifiedGeometrySink
;
14 use um
::dcommon
::DWRITE_MEASURING_MODE
;
15 use um
::unknwnbase
::{IUnknown, IUnknownVtbl}
;
16 use um
::wingdi
::LOGFONTW
;
17 use um
::winnt
::{HRESULT, WCHAR}
;
18 ENUM
!{enum DWRITE_FONT_FILE_TYPE
{
19 DWRITE_FONT_FILE_TYPE_UNKNOWN
,
20 DWRITE_FONT_FILE_TYPE_CFF
,
21 DWRITE_FONT_FILE_TYPE_TRUETYPE
,
22 DWRITE_FONT_FILE_TYPE_OPENTYPE_COLLECTION
,
23 DWRITE_FONT_FILE_TYPE_TYPE1_PFM
,
24 DWRITE_FONT_FILE_TYPE_TYPE1_PFB
,
25 DWRITE_FONT_FILE_TYPE_VECTOR
,
26 DWRITE_FONT_FILE_TYPE_BITMAP
,
27 DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION
= DWRITE_FONT_FILE_TYPE_OPENTYPE_COLLECTION
,
29 ENUM
!{enum DWRITE_FONT_FACE_TYPE
{
30 DWRITE_FONT_FACE_TYPE_CFF
,
31 DWRITE_FONT_FACE_TYPE_TRUETYPE
,
32 DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION
,
33 DWRITE_FONT_FACE_TYPE_TYPE1
,
34 DWRITE_FONT_FACE_TYPE_VECTOR
,
35 DWRITE_FONT_FACE_TYPE_BITMAP
,
36 DWRITE_FONT_FACE_TYPE_UNKNOWN
,
37 DWRITE_FONT_FACE_TYPE_RAW_CFF
,
38 DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION
= DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION
,
40 ENUM
!{enum DWRITE_FONT_SIMULATIONS
{
41 DWRITE_FONT_SIMULATIONS_NONE
= 0x0000,
42 DWRITE_FONT_SIMULATIONS_BOLD
= 0x0001,
43 DWRITE_FONT_SIMULATIONS_OBLIQUE
= 0x0002,
45 ENUM
!{enum DWRITE_FONT_WEIGHT
{
46 DWRITE_FONT_WEIGHT_THIN
= 100,
47 DWRITE_FONT_WEIGHT_EXTRA_LIGHT
= 200,
48 DWRITE_FONT_WEIGHT_ULTRA_LIGHT
= 200,
49 DWRITE_FONT_WEIGHT_LIGHT
= 300,
50 DWRITE_FONT_WEIGHT_SEMI_LIGHT
= 350,
51 DWRITE_FONT_WEIGHT_NORMAL
= 400,
52 DWRITE_FONT_WEIGHT_REGULAR
= 400,
53 DWRITE_FONT_WEIGHT_MEDIUM
= 500,
54 DWRITE_FONT_WEIGHT_DEMI_BOLD
= 600,
55 DWRITE_FONT_WEIGHT_SEMI_BOLD
= 600,
56 DWRITE_FONT_WEIGHT_BOLD
= 700,
57 DWRITE_FONT_WEIGHT_EXTRA_BOLD
= 800,
58 DWRITE_FONT_WEIGHT_ULTRA_BOLD
= 800,
59 DWRITE_FONT_WEIGHT_BLACK
= 900,
60 DWRITE_FONT_WEIGHT_HEAVY
= 900,
61 DWRITE_FONT_WEIGHT_EXTRA_BLACK
= 950,
62 DWRITE_FONT_WEIGHT_ULTRA_BLACK
= 950,
64 ENUM
!{enum DWRITE_FONT_STRETCH
{
65 DWRITE_FONT_STRETCH_UNDEFINED
= 0,
66 DWRITE_FONT_STRETCH_ULTRA_CONDENSED
= 1,
67 DWRITE_FONT_STRETCH_EXTRA_CONDENSED
= 2,
68 DWRITE_FONT_STRETCH_CONDENSED
= 3,
69 DWRITE_FONT_STRETCH_SEMI_CONDENSED
= 4,
70 DWRITE_FONT_STRETCH_NORMAL
= 5,
71 DWRITE_FONT_STRETCH_MEDIUM
= 5,
72 DWRITE_FONT_STRETCH_SEMI_EXPANDED
= 6,
73 DWRITE_FONT_STRETCH_EXPANDED
= 7,
74 DWRITE_FONT_STRETCH_EXTRA_EXPANDED
= 8,
75 DWRITE_FONT_STRETCH_ULTRA_EXPANDED
= 9,
77 ENUM
!{enum DWRITE_FONT_STYLE
{
78 DWRITE_FONT_STYLE_NORMAL
,
79 DWRITE_FONT_STYLE_OBLIQUE
,
80 DWRITE_FONT_STYLE_ITALIC
,
82 ENUM
!{enum DWRITE_INFORMATIONAL_STRING_ID
{
83 DWRITE_INFORMATIONAL_STRING_NONE
,
84 DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE
,
85 DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS
,
86 DWRITE_INFORMATIONAL_STRING_TRADEMARK
,
87 DWRITE_INFORMATIONAL_STRING_MANUFACTURER
,
88 DWRITE_INFORMATIONAL_STRING_DESIGNER
,
89 DWRITE_INFORMATIONAL_STRING_DESIGNER_URL
,
90 DWRITE_INFORMATIONAL_STRING_DESCRIPTION
,
91 DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL
,
92 DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION
,
93 DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL
,
94 DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES
,
95 DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES
,
96 DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES
,
97 DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES
,
98 DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT
,
99 DWRITE_INFORMATIONAL_STRING_FULL_NAME
,
100 DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME
,
101 DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME
,
102 DWRITE_INFORMATIONAL_STRING_WWS_FAMILY_NAME
,
103 DWRITE_INFORMATIONAL_STRING_DESIGN_SCRIPT_LANGUAGE_TAG
,
104 DWRITE_INFORMATIONAL_STRING_SUPPORTED_SCRIPT_LANGUAGE_TAG
,
106 STRUCT
!{struct DWRITE_FONT_METRICS
{
107 designUnitsPerEm
: UINT16
,
113 underlinePosition
: INT16
,
114 underlineThickness
: UINT16
,
115 strikethroughPosition
: INT16
,
116 strikethroughThickness
: UINT16
,
118 STRUCT
!{struct DWRITE_GLYPH_METRICS
{
119 leftSideBearing
: INT32
,
120 advanceWidth
: UINT32
,
121 rightSideBearing
: INT32
,
122 topSideBearing
: INT32
,
123 advanceHeight
: UINT32
,
124 bottomSideBearing
: INT32
,
125 verticalOriginY
: INT32
,
127 STRUCT
!{struct DWRITE_GLYPH_OFFSET
{
128 advanceOffset
: FLOAT
,
129 ascenderOffset
: FLOAT
,
131 ENUM
!{enum DWRITE_FACTORY_TYPE
{
132 DWRITE_FACTORY_TYPE_SHARED
,
133 DWRITE_FACTORY_TYPE_ISOLATED
,
135 RIDL
!{#[uuid(0x727cad4e, 0xd6af, 0x4c9e, 0x8a, 0x08, 0xd6, 0x95, 0xb1, 0x1c, 0xaa, 0x49)]
136 interface
IDWriteFontFileLoader(IDWriteFontFileLoaderVtbl
): IUnknown(IUnknownVtbl
) {
137 fn CreateStreamFromKey(
138 fontFileReferenceKey
: *const c_void
,
139 fontFileReferenceKeySize
: UINT32
,
140 fontFileStream
: *mut *mut IDWriteFontFileStream
,
143 RIDL
!{#[uuid(0xb2d9f3ec, 0xc9fe, 0x4a11, 0xa2, 0xec, 0xd8, 0x62, 0x08, 0xf7, 0xc0, 0xa2)]
144 interface
IDWriteLocalFontFileLoader(IDWriteLocalFontFileLoaderVtbl
):
145 IDWriteFontFileLoader(IDWriteFontFileLoaderVtbl
) {
146 fn GetFilePathLengthFromKey(
147 fontFileReferenceKey
: *const c_void
,
148 fontFileReferenceKeySize
: UINT32
,
149 filePathLength
: *mut UINT32
,
151 fn GetFilePathFromKey(
152 fontFileReferenceKey
: *const c_void
,
153 fontFileReferenceKeySize
: UINT32
,
154 filePath
: *mut WCHAR
,
155 filePathSize
: UINT32
,
157 fn GetLastWriteTimeFromKey(
158 fontFileReferenceKey
: *const c_void
,
159 fontFileReferenceKeySize
: UINT32
,
160 lastWriteTime
: *mut FILETIME
,
163 RIDL
!{#[uuid(0x6d4865fe, 0x0ab8, 0x4d91, 0x8f, 0x62, 0x5d, 0xd6, 0xbe, 0x34, 0xa3, 0xe0)]
164 interface
IDWriteFontFileStream(IDWriteFontFileStreamVtbl
): IUnknown(IUnknownVtbl
) {
166 fragmentStart
: *mut *const c_void
,
168 fragmentSize
: UINT64
,
169 fragmentContext
: *mut *mut c_void
,
171 fn ReleaseFileFragment(
172 fragmentContext
: *mut c_void
,
175 fileSize
: *mut UINT64
,
178 lastWriteTime
: *mut UINT64
,
181 ENUM
!{enum DWRITE_OUTLINE_THRESHOLD
{
182 DWRITE_OUTLINE_THRESHOLD_ANTIALIASED
,
183 DWRITE_OUTLINE_THRESHOLD_ALIASED
,
185 STRUCT
!{struct DWRITE_FONT_METRICS1
{
186 designUnitsPerEm
: UINT16
,
192 underlinePosition
: INT16
,
193 underlineThickness
: UINT16
,
194 strikethroughPosition
: INT16
,
195 strikethroughThickness
: UINT16
,
198 glyphBoxRight
: INT16
,
199 glyphBoxBottom
: INT16
,
200 subscriptPositionX
: INT16
,
201 subscriptPositionY
: INT16
,
202 subscriptSizeX
: INT16
,
203 subscriptSizeY
: INT16
,
204 superscriptPositionX
: INT16
,
205 superscriptPositionY
: INT16
,
206 superscriptSizeX
: INT16
,
207 superscriptSizeY
: INT16
,
208 hasTypographicMetrics
: BOOL
,
210 STRUCT
!{struct DWRITE_UNICODE_RANGE
{
214 STRUCT
!{struct DWRITE_CARET_METRICS
{
220 pub fn DWRITE_MAKE_OPENTYPE_TAG(a
: u8, b
: u8, c
: u8, d
: u8) -> u32 {
221 ((d
as u32) << 24) | ((c
as u32) << 16) | ((b
as u32) << 8) | (a
as u32)
223 RIDL
!{#[uuid(0x739d886a, 0xcef5, 0x47dc, 0x87, 0x69, 0x1a, 0x8b, 0x41, 0xbe, 0xbb, 0xb0)]
224 interface
IDWriteFontFile(IDWriteFontFileVtbl
): IUnknown(IUnknownVtbl
) {
226 fontFileReferenceKey
: *mut *const c_void
,
227 fontFileReferenceKeySize
: *mut UINT32
,
230 fontFileLoader
: *mut *mut IDWriteFontFileLoader
,
233 isSupportedFontType
: *mut BOOL
,
234 fontFileType
: *mut DWRITE_FONT_FILE_TYPE
,
235 fontFaceType
: *mut DWRITE_FONT_FACE_TYPE
,
236 numberOfFaces
: *mut UINT32
,
239 ENUM
!{enum DWRITE_PIXEL_GEOMETRY
{
240 DWRITE_PIXEL_GEOMETRY_FLAT
,
241 DWRITE_PIXEL_GEOMETRY_RGB
,
242 DWRITE_PIXEL_GEOMETRY_BGR
,
244 ENUM
!{enum DWRITE_RENDERING_MODE
{
245 DWRITE_RENDERING_MODE_DEFAULT
,
246 DWRITE_RENDERING_MODE_ALIASED
,
247 DWRITE_RENDERING_MODE_GDI_CLASSIC
,
248 DWRITE_RENDERING_MODE_GDI_NATURAL
,
249 DWRITE_RENDERING_MODE_NATURAL
,
250 DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
,
251 DWRITE_RENDERING_MODE_OUTLINE
,
252 DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC
= DWRITE_RENDERING_MODE_GDI_CLASSIC
,
253 DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL
= DWRITE_RENDERING_MODE_GDI_NATURAL
,
254 DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL
= DWRITE_RENDERING_MODE_NATURAL
,
255 DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC
= DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
,
257 STRUCT
!{struct DWRITE_MATRIX
{
265 RIDL
!{#[uuid(0x2f0da53a, 0x2add, 0x47cd, 0x82, 0xee, 0xd9, 0xec, 0x34, 0x68, 0x8e, 0x75)]
266 interface
IDWriteRenderingParams(IDWriteRenderingParamsVtbl
): IUnknown(IUnknownVtbl
) {
267 fn GetGamma() -> FLOAT
,
268 fn GetEnhancedContrast() -> FLOAT
,
269 fn GetClearTypeLevel() -> FLOAT
,
270 fn GetPixelGeometry() -> DWRITE_PIXEL_GEOMETRY
,
271 fn GetRenderingMode() -> DWRITE_RENDERING_MODE
,
273 pub type IDWriteGeometrySink
= ID2D1SimplifiedGeometrySink
;
274 RIDL
!{#[uuid(0x5f49804d, 0x7024, 0x4d43, 0xbf, 0xa9, 0xd2, 0x59, 0x84, 0xf5, 0x38, 0x49)]
275 interface
IDWriteFontFace(IDWriteFontFaceVtbl
): IUnknown(IUnknownVtbl
) {
276 fn GetType() -> DWRITE_FONT_FACE_TYPE
,
278 numberOfFiles
: *mut UINT32
,
279 fontFiles
: *mut *mut IDWriteFontFile
,
281 fn GetIndex() -> UINT32
,
282 fn GetSimulations() -> DWRITE_FONT_SIMULATIONS
,
283 fn IsSymbolFont() -> BOOL
,
285 fontFaceMetrics
: *mut DWRITE_FONT_METRICS
,
287 fn GetGlyphCount() -> UINT16
,
288 fn GetDesignGlyphMetrics(
289 glyphIndices
: *const UINT16
,
291 glyphMetrics
: *mut DWRITE_GLYPH_METRICS
,
295 codePoints
: *const UINT32
,
296 codePointCount
: UINT32
,
297 glyphIndices
: *mut UINT16
,
300 openTypeTableTag
: UINT32
,
301 tableData
: *mut *const c_void
,
302 tableSize
: *mut UINT32
,
303 tableContext
: *mut *mut c_void
,
307 tableContext
: *mut c_void
,
309 fn GetGlyphRunOutline(
311 glyphIndices
: *const UINT16
,
312 glyphAdvances
: *const FLOAT
,
313 glyphOffsets
: *const DWRITE_GLYPH_OFFSET
,
317 geometrySink
: *mut IDWriteGeometrySink
,
319 fn GetRecommendedRenderingMode(
322 measuringMode
: DWRITE_MEASURING_MODE
,
323 renderingParams
: *mut IDWriteRenderingParams
,
324 renderingMode
: *mut DWRITE_RENDERING_MODE
,
326 fn GetGdiCompatibleMetrics(
329 transform
: *const DWRITE_MATRIX
,
330 fontFaceMetrics
: *mut DWRITE_FONT_METRICS
,
332 fn GetGdiCompatibleGlyphMetrics(
335 transform
: *const DWRITE_MATRIX
,
337 glyphIndices
: *const UINT16
,
339 glyphMetrics
: *mut DWRITE_GLYPH_METRICS
,
343 RIDL
!{#[uuid(0xa71efdb4, 0x9fdb, 0x4838, 0xad, 0x90, 0xcf, 0xc3, 0xbe, 0x8c, 0x3d, 0xaf)]
344 interface
IDWriteFontFace1(IDWriteFontFace1Vtbl
): IDWriteFontFace(IDWriteFontFaceVtbl
) {
346 fontFaceMetrics
: *mut DWRITE_FONT_METRICS1
,
348 fn GetGdiCompatibleMetrics(
351 transform
: *const DWRITE_MATRIX
,
352 fontFaceMetrics
: *mut DWRITE_FONT_METRICS1
,
355 caretMetrics
: *mut DWRITE_CARET_METRICS
,
358 maxRangeCount
: UINT32
,
359 unicodeRanges
: *mut DWRITE_UNICODE_RANGE
,
360 actualRangeCount
: *mut UINT32
,
362 fn IsMonoSpacedFont() -> BOOL
,
363 fn GetDesignGlyphAdvances(
365 glyphIndices
: *const UINT16
,
366 glyphAdvances
: *mut INT32
,
369 fn GetGdiCompatibleGlyphAdvance(
372 transform
: *const DWRITE_MATRIX
,
376 glyphIndices
: *const UINT16
,
377 glyphAdvances
: *mut INT32
,
379 fn GetKerningPairAdjustments(
381 glyphIndices
: *const UINT16
,
382 glyphAdvanceAdjustments
: *mut INT32
,
384 fn HasKerningPairs() -> BOOL
,
385 fn GetRecommendedRenderingMode(
389 transform
: *const DWRITE_MATRIX
,
391 outlineThreshold
: DWRITE_OUTLINE_THRESHOLD
,
392 measuringMode
: DWRITE_MEASURING_MODE
,
393 renderingMode
: *mut DWRITE_RENDERING_MODE
,
395 fn GetVerticalGlyphVariants(
396 nominalGlyphIndices
: *const UINT16
,
397 verticalGlyphIndices
: *mut UINT16
,
399 fn HasVerticalGlyphVariants() -> BOOL
,
401 RIDL
!{#[uuid(0xcca920e4, 0x52f0, 0x492b, 0xbf, 0xa8, 0x29, 0xc7, 0x2e, 0xe0, 0xa4, 0x68)]
402 interface
IDWriteFontCollectionLoader(IDWriteFontCollectionLoaderVtbl
):
403 IUnknown(IUnknownVtbl
) {
404 fn CreateEnumeratorFromKey(
405 factory
: *mut IDWriteFactory
,
406 collectionKey
: *const c_void
,
407 collectionKeySize
: UINT32
,
408 fontFileEnumerator
: *mut *mut IDWriteFontFileEnumerator
,
411 RIDL
!{#[uuid(0x72755049, 0x5ff7, 0x435d, 0x83, 0x48, 0x4b, 0xe9, 0x7c, 0xfa, 0x6c, 0x7c)]
412 interface
IDWriteFontFileEnumerator(IDWriteFontFileEnumeratorVtbl
): IUnknown(IUnknownVtbl
) {
414 hasCurrentFile
: *mut BOOL
,
416 fn GetCurrentFontFile(
417 fontFile
: *mut *mut IDWriteFontFile
,
420 RIDL
!{#[uuid(0x08256209, 0x099a, 0x4b34, 0xb8, 0x6d, 0xc2, 0x2b, 0x11, 0x0e, 0x77, 0x71)]
421 interface
IDWriteLocalizedStrings(IDWriteLocalizedStringsVtbl
): IUnknown(IUnknownVtbl
) {
422 fn GetCount() -> UINT32
,
424 localeName
: *const WCHAR
,
428 fn GetLocaleNameLength(
434 localeName
: *mut WCHAR
,
443 stringBuffer
: *mut WCHAR
,
447 RIDL
!{#[uuid(0xa84cee02, 0x3eea, 0x4eee, 0xa8, 0x27, 0x87, 0xc1, 0xa0, 0x2a, 0x0f, 0xcc)]
448 interface
IDWriteFontCollection(IDWriteFontCollectionVtbl
): IUnknown(IUnknownVtbl
) {
449 fn GetFontFamilyCount() -> UINT32
,
452 fontFamily
: *mut *mut IDWriteFontFamily
,
455 familyName
: *const WCHAR
,
459 fn GetFontFromFontFace(
460 fontFace
: *mut IDWriteFontFace
,
461 font
: *mut *mut IDWriteFont
,
464 RIDL
!{#[uuid(0x1a0d8438, 0x1d97, 0x4ec1, 0xae, 0xf9, 0xa2, 0xfb, 0x86, 0xed, 0x6a, 0xcb)]
465 interface
IDWriteFontList(IDWriteFontListVtbl
): IUnknown(IUnknownVtbl
) {
466 fn GetFontCollection(
467 fontCollection
: *mut *mut IDWriteFontCollection
,
469 fn GetFontCount() -> UINT32
,
472 font
: *mut *mut IDWriteFont
,
475 RIDL
!{#[uuid(0xda20d8ef, 0x812a, 0x4c43, 0x98, 0x02, 0x62, 0xec, 0x4a, 0xbd, 0x7a, 0xdd)]
476 interface
IDWriteFontFamily(IDWriteFontFamilyVtbl
): IDWriteFontList(IDWriteFontListVtbl
) {
478 names
: *mut *mut IDWriteLocalizedStrings
,
480 fn GetFirstMatchingFont(
481 weight
: DWRITE_FONT_WEIGHT
,
482 stretch
: DWRITE_FONT_STRETCH
,
483 style
: DWRITE_FONT_STYLE
,
484 matchingFont
: *mut *mut IDWriteFont
,
487 weight
: DWRITE_FONT_WEIGHT
,
488 stretch
: DWRITE_FONT_STRETCH
,
489 style
: DWRITE_FONT_STYLE
,
490 matchingFonts
: *mut *mut IDWriteFontList
,
493 RIDL
!{#[uuid(0xacd16696, 0x8c14, 0x4f5d, 0x87, 0x7e, 0xfe, 0x3f, 0xc1, 0xd3, 0x27, 0x37)]
494 interface
IDWriteFont(IDWriteFontVtbl
): IUnknown(IUnknownVtbl
) {
496 fontFamily
: *mut *mut IDWriteFontFamily
,
498 fn GetWeight() -> DWRITE_FONT_WEIGHT
,
499 fn GetStretch() -> DWRITE_FONT_STRETCH
,
500 fn GetStyle() -> DWRITE_FONT_STYLE
,
501 fn IsSymbolFont() -> BOOL
,
503 names
: *mut *mut IDWriteLocalizedStrings
,
505 fn GetInformationalStrings(
506 informationalStringId
: DWRITE_INFORMATIONAL_STRING_ID
,
507 informationalStrings
: *mut *mut IDWriteLocalizedStrings
,
510 fn GetSimulations() -> DWRITE_FONT_SIMULATIONS
,
512 fontMetrics
: *mut DWRITE_FONT_METRICS
,
515 unicodeValue
: UINT32
,
519 fontFace
: *mut *mut IDWriteFontFace
,
522 ENUM
!{enum DWRITE_READING_DIRECTION
{
523 DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
= 0,
524 DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
= 1,
525 DWRITE_READING_DIRECTION_TOP_TO_BOTTOM
= 2,
526 DWRITE_READING_DIRECTION_BOTTOM_TO_TOP
= 3,
528 ENUM
!{enum DWRITE_FLOW_DIRECTION
{
529 DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
= 0,
530 DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP
= 1,
531 DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT
= 2,
532 DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT
= 3,
534 ENUM
!{enum DWRITE_TEXT_ALIGNMENT
{
535 DWRITE_TEXT_ALIGNMENT_LEADING
,
536 DWRITE_TEXT_ALIGNMENT_TRAILING
,
537 DWRITE_TEXT_ALIGNMENT_CENTER
,
538 DWRITE_TEXT_ALIGNMENT_JUSTIFIED
,
540 ENUM
!{enum DWRITE_PARAGRAPH_ALIGNMENT
{
541 DWRITE_PARAGRAPH_ALIGNMENT_NEAR
,
542 DWRITE_PARAGRAPH_ALIGNMENT_FAR
,
543 DWRITE_PARAGRAPH_ALIGNMENT_CENTER
,
545 ENUM
!{enum DWRITE_WORD_WRAPPING
{
546 DWRITE_WORD_WRAPPING_WRAP
= 0,
547 DWRITE_WORD_WRAPPING_NO_WRAP
= 1,
548 DWRITE_WORD_WRAPPING_EMERGENCY_BREAK
= 2,
549 DWRITE_WORD_WRAPPING_WHOLE_WORD
= 3,
550 DWRITE_WORD_WRAPPING_CHARACTER
= 4,
552 ENUM
!{enum DWRITE_LINE_SPACING_METHOD
{
553 DWRITE_LINE_SPACING_METHOD_DEFAULT
,
554 DWRITE_LINE_SPACING_METHOD_UNIFORM
,
555 DWRITE_LINE_SPACING_METHOD_PROPORTIONAL
,
557 ENUM
!{enum DWRITE_TRIMMING_GRANULARITY
{
558 DWRITE_TRIMMING_GRANULARITY_NONE
,
559 DWRITE_TRIMMING_GRANULARITY_CHARACTER
,
560 DWRITE_TRIMMING_GRANULARITY_WORD
,
562 ENUM
!{enum DWRITE_FONT_FEATURE_TAG
{
563 DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS
= 0x63726661, // 'afrc'
564 DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS
= 0x63703263, // 'c2pc'
565 DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS
= 0x63733263, // 'c2sc'
566 DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES
= 0x746c6163, // 'calt'
567 DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS
= 0x65736163, // 'case'
568 DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION
= 0x706d6363, // 'ccmp'
569 DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES
= 0x67696c63, // 'clig'
570 DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING
= 0x70737063, // 'cpsp'
571 DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH
= 0x68777363, // 'cswh'
572 DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING
= 0x73727563, // 'curs'
573 DWRITE_FONT_FEATURE_TAG_DEFAULT
= 0x746c6664, // 'dflt'
574 DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES
= 0x67696c64, // 'dlig'
575 DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS
= 0x74707865, // 'expt'
576 DWRITE_FONT_FEATURE_TAG_FRACTIONS
= 0x63617266, // 'frac'
577 DWRITE_FONT_FEATURE_TAG_FULL_WIDTH
= 0x64697766, // 'fwid'
578 DWRITE_FONT_FEATURE_TAG_HALF_FORMS
= 0x666c6168, // 'half'
579 DWRITE_FONT_FEATURE_TAG_HALANT_FORMS
= 0x6e6c6168, // 'haln'
580 DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH
= 0x746c6168, // 'halt'
581 DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS
= 0x74736968, // 'hist'
582 DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES
= 0x616e6b68, // 'hkna'
583 DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES
= 0x67696c68, // 'hlig'
584 DWRITE_FONT_FEATURE_TAG_HALF_WIDTH
= 0x64697768, // 'hwid'
585 DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS
= 0x6f6a6f68, // 'hojo'
586 DWRITE_FONT_FEATURE_TAG_JIS04_FORMS
= 0x3430706a, // 'jp04'
587 DWRITE_FONT_FEATURE_TAG_JIS78_FORMS
= 0x3837706a, // 'jp78'
588 DWRITE_FONT_FEATURE_TAG_JIS83_FORMS
= 0x3338706a, // 'jp83'
589 DWRITE_FONT_FEATURE_TAG_JIS90_FORMS
= 0x3039706a, // 'jp90'
590 DWRITE_FONT_FEATURE_TAG_KERNING
= 0x6e72656b, // 'kern'
591 DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES
= 0x6167696c, // 'liga'
592 DWRITE_FONT_FEATURE_TAG_LINING_FIGURES
= 0x6d756e6c, // 'lnum'
593 DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS
= 0x6c636f6c, // 'locl'
594 DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING
= 0x6b72616d, // 'mark'
595 DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK
= 0x6b72676d, // 'mgrk'
596 DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING
= 0x6b6d6b6d, // 'mkmk'
597 DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS
= 0x746c616e, // 'nalt'
598 DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS
= 0x6b636c6e, // 'nlck'
599 DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES
= 0x6d756e6f, // 'onum'
600 DWRITE_FONT_FEATURE_TAG_ORDINALS
= 0x6e64726f, // 'ordn'
601 DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH
= 0x746c6170, // 'palt'
602 DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS
= 0x70616370, // 'pcap'
603 DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES
= 0x6d756e70, // 'pnum'
604 DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS
= 0x64697770, // 'pwid'
605 DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS
= 0x64697771, // 'qwid'
606 DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES
= 0x67696c72, // 'rlig'
607 DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS
= 0x79627572, // 'ruby'
608 DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES
= 0x746c6173, // 'salt'
609 DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS
= 0x666e6973, // 'sinf'
610 DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS
= 0x70636d73, // 'smcp'
611 DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS
= 0x6c706d73, // 'smpl'
612 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1
= 0x31307373, // 'ss01'
613 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2
= 0x32307373, // 'ss02'
614 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3
= 0x33307373, // 'ss03'
615 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4
= 0x34307373, // 'ss04'
616 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5
= 0x35307373, // 'ss05'
617 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6
= 0x36307373, // 'ss06'
618 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7
= 0x37307373, // 'ss07'
619 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8
= 0x38307373, // 'ss08'
620 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9
= 0x39307373, // 'ss09'
621 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10
= 0x30317373, // 'ss10'
622 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11
= 0x31317373, // 'ss11'
623 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12
= 0x32317373, // 'ss12'
624 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13
= 0x33317373, // 'ss13'
625 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14
= 0x34317373, // 'ss14'
626 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15
= 0x35317373, // 'ss15'
627 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16
= 0x36317373, // 'ss16'
628 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17
= 0x37317373, // 'ss17'
629 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18
= 0x38317373, // 'ss18'
630 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19
= 0x39317373, // 'ss19'
631 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20
= 0x30327373, // 'ss20'
632 DWRITE_FONT_FEATURE_TAG_SUBSCRIPT
= 0x73627573, // 'subs'
633 DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT
= 0x73707573, // 'sups'
634 DWRITE_FONT_FEATURE_TAG_SWASH
= 0x68737773, // 'swsh'
635 DWRITE_FONT_FEATURE_TAG_TITLING
= 0x6c746974, // 'titl'
636 DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS
= 0x6d616e74, // 'tnam'
637 DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES
= 0x6d756e74, // 'tnum'
638 DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS
= 0x64617274, // 'trad'
639 DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS
= 0x64697774, // 'twid'
640 DWRITE_FONT_FEATURE_TAG_UNICASE
= 0x63696e75, // 'unic'
641 DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING
= 0x74726576, // 'vert'
642 DWRITE_FONT_FEATURE_TAG_VERTICAL_ALTERNATES_AND_ROTATION
= 0x32747276, // 'vrt2'
643 DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO
= 0x6f72657a, // 'zero'
645 STRUCT
!{struct DWRITE_TEXT_RANGE
{
646 startPosition
: UINT32
,
649 STRUCT
!{struct DWRITE_FONT_FEATURE
{
650 nameTag
: DWRITE_FONT_FEATURE_TAG
,
653 STRUCT
!{struct DWRITE_TYPOGRAPHIC_FEATURES
{
654 features
: *mut DWRITE_FONT_FEATURE
,
655 featureCount
: UINT32
,
657 STRUCT
!{struct DWRITE_TRIMMING
{
658 granularity
: DWRITE_TRIMMING_GRANULARITY
,
660 delimiterCount
: UINT32
,
662 RIDL
!{#[uuid(0x9c906818, 0x31d7, 0x4fd3, 0xa1, 0x51, 0x7c, 0x5e, 0x22, 0x5d, 0xb5, 0x5a)]
663 interface
IDWriteTextFormat(IDWriteTextFormatVtbl
): IUnknown(IUnknownVtbl
) {
665 textAlignment
: DWRITE_TEXT_ALIGNMENT
,
667 fn SetParagraphAlignment(
668 paragraphAlignment
: DWRITE_PARAGRAPH_ALIGNMENT
,
671 wordWrapping
: DWRITE_WORD_WRAPPING
,
673 fn SetReadingDirection(
674 readingDirection
: DWRITE_READING_DIRECTION
,
677 flowDirection
: DWRITE_FLOW_DIRECTION
,
679 fn SetIncrementalTabStop(
680 incrementalTabStop
: FLOAT
,
683 trimmingOptions
: *const DWRITE_TRIMMING
,
684 trimmingSign
: *mut IDWriteInlineObject
,
687 lineSpacingMethod
: DWRITE_LINE_SPACING_METHOD
,
691 fn GetTextAlignment() -> DWRITE_TEXT_ALIGNMENT
,
692 fn GetParagraphAlignment() -> DWRITE_PARAGRAPH_ALIGNMENT
,
693 fn GetWordWrapping() -> DWRITE_WORD_WRAPPING
,
694 fn GetReadingDirection() -> DWRITE_READING_DIRECTION
,
695 fn GetFlowDirection() -> DWRITE_FLOW_DIRECTION
,
696 fn GetIncrementalTabStop() -> FLOAT
,
698 trimmingOptions
: *mut DWRITE_TRIMMING
,
699 trimmingSign
: *mut *mut IDWriteInlineObject
,
702 lineSpacingMethod
: *mut DWRITE_LINE_SPACING_METHOD
,
703 lineSpacing
: *mut FLOAT
,
704 baseline
: *mut FLOAT
,
706 fn GetFontCollection(
707 fontCollection
: *mut *mut IDWriteFontCollection
,
709 fn GetFontFamilyNameLength() -> UINT32
,
710 fn GetFontFamilyName(
711 fontFamilyName
: *mut WCHAR
,
714 fn GetFontWeight() -> DWRITE_FONT_WEIGHT
,
715 fn GetFontStyle() -> DWRITE_FONT_STYLE
,
716 fn GetFontStretch() -> DWRITE_FONT_STRETCH
,
717 fn GetFontSize() -> FLOAT
,
718 fn GetLocaleNameLength() -> UINT32
,
720 localeName
: *mut WCHAR
,
724 RIDL
!{#[uuid(0x55f1112b, 0x1dc2, 0x4b3c, 0x95, 0x41, 0xf4, 0x68, 0x94, 0xed, 0x85, 0xb6)]
725 interface
IDWriteTypography(IDWriteTypographyVtbl
): IUnknown(IUnknownVtbl
) {
727 fontFeature
: DWRITE_FONT_FEATURE
,
729 fn GetFontFeatureCount() -> UINT32
,
731 fontFeatureIndex
: UINT32
,
732 fontFeature
: *mut DWRITE_FONT_FEATURE
,
735 ENUM
!{enum DWRITE_SCRIPT_SHAPES
{
736 DWRITE_SCRIPT_SHAPES_DEFAULT
= 0,
737 DWRITE_SCRIPT_SHAPES_NO_VISUAL
= 1,
739 STRUCT
!{struct DWRITE_SCRIPT_ANALYSIS
{
741 shapes
: DWRITE_SCRIPT_SHAPES
,
743 ENUM
!{enum DWRITE_BREAK_CONDITION
{
744 DWRITE_BREAK_CONDITION_NEUTRAL
,
745 DWRITE_BREAK_CONDITION_CAN_BREAK
,
746 DWRITE_BREAK_CONDITION_MAY_NOT_BREAK
,
747 DWRITE_BREAK_CONDITION_MUST_BREAK
,
749 STRUCT
!{struct DWRITE_LINE_BREAKPOINT
{
752 BITFIELD
!{DWRITE_LINE_BREAKPOINT bit_fields
: UINT8
[
753 breakConditionBefore set_breakConditionBefore
[0..2],
754 breakConditionAfter set_breakConditionAfter
[2..4],
755 isWhitespace set_isWhitespace
[4..5],
756 isSoftHyphen set_isSoftHyphen
[5..6],
757 padding set_padding
[6..8],
759 ENUM
!{enum DWRITE_NUMBER_SUBSTITUTION_METHOD
{
760 DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE
,
761 DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL
,
762 DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE
,
763 DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL
,
764 DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL
,
766 RIDL
!{#[uuid(0x14885cc9, 0xbab0, 0x4f90, 0xb6, 0xed, 0x5c, 0x36, 0x6a, 0x2c, 0xd0, 0x3d)]
767 interface
IDWriteNumberSubstitution(IDWriteNumberSubstitutionVtbl
): IUnknown(IUnknownVtbl
) {}
}
768 STRUCT
!{struct DWRITE_SHAPING_TEXT_PROPERTIES
{
771 BITFIELD
!{DWRITE_SHAPING_TEXT_PROPERTIES bit_fields
: UINT16
[
772 isShapedAlone set_isShapedAlone
[0..1],
773 reserved set_reserved
[1..16],
775 STRUCT
!{struct DWRITE_SHAPING_GLYPH_PROPERTIES
{
778 BITFIELD
!{DWRITE_SHAPING_GLYPH_PROPERTIES bit_fields
: UINT16
[
779 justification set_justification
[0..4],
780 isClusterStart set_isClusterStart
[4..5],
781 isDiacritic set_isDiacritic
[5..6],
782 isZeroWidthSpace set_isZeroWidthSpace
[6..7],
783 reserved set_reserved
[7..16],
785 RIDL
!{#[uuid(0x688e1a58, 0x5094, 0x47c8, 0xad, 0xc8, 0xfb, 0xce, 0xa6, 0x0a, 0xe9, 0x2b)]
786 interface
IDWriteTextAnalysisSource(IDWriteTextAnalysisSourceVtbl
): IUnknown(IUnknownVtbl
) {
787 fn GetTextAtPosition(
788 textPosition
: UINT32
,
789 textString
: *mut *const WCHAR
,
790 textLength
: *mut UINT32
,
792 fn GetTextBeforePosition(
793 textPosition
: UINT32
,
794 textString
: *mut *const WCHAR
,
795 textLength
: *mut UINT32
,
797 fn GetParagraphReadingDirection() -> DWRITE_READING_DIRECTION
,
799 textPosition
: UINT32
,
800 textLength
: *mut UINT32
,
801 localeName
: *mut *const WCHAR
,
803 fn GetNumberSubstitution(
804 textPosition
: UINT32
,
805 textLength
: *mut UINT32
,
806 numberSubstitution
: *mut *mut IDWriteNumberSubstitution
,
809 RIDL
!{#[uuid(0x5810cd44, 0x0ca0, 0x4701, 0xb3, 0xfa, 0xbe, 0xc5, 0x18, 0x2a, 0xe4, 0xf6)]
810 interface
IDWriteTextAnalysisSink(IDWriteTextAnalysisSinkVtbl
): IUnknown(IUnknownVtbl
) {
811 fn SetScriptAnalysis(
812 textPosition
: UINT32
,
814 scriptAnalysis
: *const DWRITE_SCRIPT_ANALYSIS
,
816 fn SetLineBreakpoints(
817 textPosition
: UINT32
,
819 lineBreakpoints
: *const DWRITE_LINE_BREAKPOINT
,
822 textPosition
: UINT32
,
824 explicitLevel
: UINT8
,
825 resolvedLevel
: UINT8
,
827 fn SetNumberSubstitution(
828 textPosition
: UINT32
,
830 numberSubstitution
: *mut IDWriteNumberSubstitution
,
833 RIDL
!{#[uuid(0xb7e6163e, 0x7f46, 0x43b4, 0x84, 0xb3, 0xe4, 0xe6, 0x24, 0x9c, 0x36, 0x5d)]
834 interface
IDWriteTextAnalyzer(IDWriteTextAnalyzerVtbl
): IUnknown(IUnknownVtbl
) {
836 analysisSource
: *mut IDWriteTextAnalysisSource
,
837 textPosition
: UINT32
,
839 analysisSink
: *mut IDWriteTextAnalysisSink
,
842 analysisSource
: *mut IDWriteTextAnalysisSource
,
843 textPosition
: UINT32
,
845 analysisSink
: *mut IDWriteTextAnalysisSink
,
847 fn AnalyzeNumberSubstitution(
848 analysisSource
: *mut IDWriteTextAnalysisSource
,
849 textPosition
: UINT32
,
851 analysisSink
: *mut IDWriteTextAnalysisSink
,
853 fn AnalyzeLineBreakpoints(
854 analysisSource
: *mut IDWriteTextAnalysisSource
,
855 textPosition
: UINT32
,
857 analysisSink
: *mut IDWriteTextAnalysisSink
,
860 textString
: *const WCHAR
,
862 fontFace
: *mut IDWriteFontFace
,
865 scriptAnalysis
: *const DWRITE_SCRIPT_ANALYSIS
,
866 localeName
: *const WCHAR
,
867 numberSubstitution
: *mut IDWriteNumberSubstitution
,
868 features
: *mut *const DWRITE_TYPOGRAPHIC_FEATURES
,
869 featureRangeLengths
: *const UINT32
,
870 featureRanges
: UINT32
,
871 maxGlyphCount
: UINT32
,
872 clusterMap
: *mut UINT16
,
873 textProps
: *mut DWRITE_SHAPING_TEXT_PROPERTIES
,
874 glyphIndices
: *mut UINT16
,
875 glyphProps
: *mut DWRITE_SHAPING_GLYPH_PROPERTIES
,
876 actualGlyphCount
: *mut UINT32
,
878 fn GetGlyphPlacements(
879 textString
: *const WCHAR
,
880 clusterMap
: *const UINT16
,
881 textProps
: *mut DWRITE_SHAPING_TEXT_PROPERTIES
,
883 glyphIndices
: *const UINT16
,
884 glyphProps
: *const DWRITE_SHAPING_GLYPH_PROPERTIES
,
886 fontFace
: *mut IDWriteFontFace
,
890 scriptAnalysis
: *const DWRITE_SCRIPT_ANALYSIS
,
891 localeName
: *const WCHAR
,
892 features
: *mut *const DWRITE_TYPOGRAPHIC_FEATURES
,
893 featureRangeLengths
: *const UINT32
,
894 featureRanges
: UINT32
,
895 glyphAdvances
: *mut FLOAT
,
896 glyphOffsets
: *mut DWRITE_GLYPH_OFFSET
,
898 fn GetGdiCompatibleGlyphPlacements(
899 textString
: *const WCHAR
,
900 clusterMap
: *const UINT16
,
901 textProps
: *mut DWRITE_SHAPING_TEXT_PROPERTIES
,
903 glyphIndices
: *const UINT16
,
904 glyphProps
: *const DWRITE_SHAPING_GLYPH_PROPERTIES
,
906 fontFace
: *mut IDWriteFontFace
,
909 transform
: *const DWRITE_MATRIX
,
913 scriptAnalysis
: *const DWRITE_SCRIPT_ANALYSIS
,
914 localeName
: *const WCHAR
,
915 features
: *mut *const DWRITE_TYPOGRAPHIC_FEATURES
,
916 featureRangeLengths
: *const UINT32
,
917 featureRanges
: UINT32
,
918 glyphAdvances
: *mut FLOAT
,
919 glyphOffsets
: *mut DWRITE_GLYPH_OFFSET
,
922 STRUCT
!{struct DWRITE_GLYPH_RUN
{
923 fontFace
: *mut IDWriteFontFace
,
926 glyphIndices
: *const UINT16
,
927 glyphAdvances
: *const FLOAT
,
928 glyphOffsets
: *const DWRITE_GLYPH_OFFSET
,
932 STRUCT
!{struct DWRITE_GLYPH_RUN_DESCRIPTION
{
933 localeName
: *const WCHAR
,
934 string
: *const WCHAR
,
935 stringLength
: UINT32
,
936 clusterMap
: *const UINT16
,
937 textPosition
: UINT32
,
939 STRUCT
!{struct DWRITE_UNDERLINE
{
944 readingDirection
: DWRITE_READING_DIRECTION
,
945 flowDirection
: DWRITE_FLOW_DIRECTION
,
946 localeName
: *const WCHAR
,
947 measuringMode
: DWRITE_MEASURING_MODE
,
949 STRUCT
!{struct DWRITE_STRIKETHROUGH
{
953 readingDirection
: DWRITE_READING_DIRECTION
,
954 flowDirection
: DWRITE_FLOW_DIRECTION
,
955 localeName
: *const WCHAR
,
956 measuringMode
: DWRITE_MEASURING_MODE
,
958 STRUCT
!{struct DWRITE_LINE_METRICS
{
960 trailingWhitespaceLength
: UINT32
,
961 newlineLength
: UINT32
,
966 STRUCT
!{struct DWRITE_CLUSTER_METRICS
{
971 BITFIELD
!{DWRITE_CLUSTER_METRICS bit_fields
: UINT16
[
972 canWrapLineAfter set_canWrapLineAfter
[0..1],
973 isWhitespace set_isWhitespace
[1..2],
974 isNewline set_isNewline
[2..3],
975 isSoftHyphen set_isSoftHyphen
[3..4],
976 isRightToLeft set_isRightToLeft
[4..5],
977 padding set_padding
[5..16],
979 STRUCT
!{struct DWRITE_TEXT_METRICS
{
983 widthIncludingTrailingWhitespace
: FLOAT
,
987 maxBidiReorderingDepth
: UINT32
,
990 STRUCT
!{struct DWRITE_INLINE_OBJECT_METRICS
{
994 supportsSideways
: BOOL
,
996 STRUCT
!{struct DWRITE_OVERHANG_METRICS
{
1002 STRUCT
!{struct DWRITE_HIT_TEST_METRICS
{
1003 textPosition
: UINT32
,
1013 RIDL
!{#[uuid(0x8339fde3, 0x106f, 0x47ab, 0x83, 0x73, 0x1c, 0x62, 0x95, 0xeb, 0x10, 0xb3)]
1014 interface
IDWriteInlineObject(IDWriteInlineObjectVtbl
): IUnknown(IUnknownVtbl
) {
1016 clientDrawingContext
: *mut c_void
,
1017 renderer
: *mut IDWriteTextRenderer
,
1021 isRightToLeft
: BOOL
,
1022 clientDrawingEffect
: *mut IUnknown
,
1025 metrics
: *mut DWRITE_INLINE_OBJECT_METRICS
,
1027 fn GetOverhangMetrics(
1028 overhangs
: *mut DWRITE_OVERHANG_METRICS
,
1030 fn GetBreakConditions(
1031 breakConditionBefore
: *mut DWRITE_BREAK_CONDITION
,
1032 breakConditionAfter
: *mut DWRITE_BREAK_CONDITION
,
1035 RIDL
!{#[uuid(0xeaf3a2da, 0xecf4, 0x4d24, 0xb6, 0x44, 0xb3, 0x4f, 0x68, 0x42, 0x02, 0x4b)]
1036 interface
IDWritePixelSnapping(IDWritePixelSnappingVtbl
): IUnknown(IUnknownVtbl
) {
1037 fn IsPixelSnappingDisabled(
1038 clientDrawingContext
: *mut c_void
,
1039 isDisabled
: *mut BOOL
,
1041 fn GetCurrentTransform(
1042 clientDrawingContext
: *mut c_void
,
1043 transform
: *mut DWRITE_MATRIX
,
1046 clientDrawingContext
: *mut c_void
,
1047 pixelsPerDip
: *mut FLOAT
,
1050 RIDL
!{#[uuid(0xef8a8135, 0x5cc6, 0x45fe, 0x88, 0x25, 0xc5, 0xa0, 0x72, 0x4e, 0xb8, 0x19)]
1051 interface
IDWriteTextRenderer(IDWriteTextRendererVtbl
):
1052 IDWritePixelSnapping(IDWritePixelSnappingVtbl
) {
1054 clientDrawingContext
: *mut c_void
,
1055 baselineOriginX
: FLOAT
,
1056 baselineOriginY
: FLOAT
,
1057 measuringMode
: DWRITE_MEASURING_MODE
,
1058 glyphRun
: *const DWRITE_GLYPH_RUN
,
1059 glyphRunDescription
: *const DWRITE_GLYPH_RUN_DESCRIPTION
,
1060 clientDrawingEffect
: *mut IUnknown
,
1063 clientDrawingContext
: *mut c_void
,
1064 baselineOriginX
: FLOAT
,
1065 baselineOriginY
: FLOAT
,
1066 underline
: *const DWRITE_UNDERLINE
,
1067 clientDrawingEffect
: *mut IUnknown
,
1069 fn DrawStrikethrough(
1070 clientDrawingContext
: *mut c_void
,
1071 baselineOriginX
: FLOAT
,
1072 baselineOriginY
: FLOAT
,
1073 strikethrough
: *const DWRITE_STRIKETHROUGH
,
1074 clientDrawingEffect
: *mut IUnknown
,
1076 fn DrawInlineObject(
1077 clientDrawingContext
: *mut c_void
,
1078 baselineOriginX
: FLOAT
,
1079 baselineOriginY
: FLOAT
,
1080 inlineObject
: *mut IDWriteInlineObject
,
1082 isRightToLeft
: BOOL
,
1083 clientDrawingEffect
: *mut IUnknown
,
1086 RIDL
!{#[uuid(0x53737037, 0x6d14, 0x410b, 0x9b, 0xfe, 0x0b, 0x18, 0x2b, 0xb7, 0x09, 0x61)]
1087 interface
IDWriteTextLayout(IDWriteTextLayoutVtbl
):
1088 IDWriteTextFormat(IDWriteTextFormatVtbl
) {
1095 fn SetFontCollection(
1096 fontCollection
: *mut IDWriteFontCollection
,
1097 textRange
: DWRITE_TEXT_RANGE
,
1099 fn SetFontFamilyName(
1100 fontFamilyName
: *const WCHAR
,
1101 textRange
: DWRITE_TEXT_RANGE
,
1104 fontWeight
: DWRITE_FONT_WEIGHT
,
1105 textRange
: DWRITE_TEXT_RANGE
,
1108 fontStyle
: DWRITE_FONT_STYLE
,
1109 textRange
: DWRITE_TEXT_RANGE
,
1112 fontStretch
: DWRITE_FONT_STRETCH
,
1113 textRange
: DWRITE_TEXT_RANGE
,
1117 textRange
: DWRITE_TEXT_RANGE
,
1121 textRange
: DWRITE_TEXT_RANGE
,
1123 fn SetStrikethrough(
1124 hasStrikethrough
: BOOL
,
1125 textRange
: DWRITE_TEXT_RANGE
,
1127 fn SetDrawingEffect(
1128 drawingEffect
: *mut IUnknown
,
1129 textRange
: DWRITE_TEXT_RANGE
,
1132 inlineObject
: *mut IDWriteInlineObject
,
1133 textRange
: DWRITE_TEXT_RANGE
,
1136 typography
: *mut IDWriteTypography
,
1137 textRange
: DWRITE_TEXT_RANGE
,
1140 localeName
: *const WCHAR
,
1141 textRange
: DWRITE_TEXT_RANGE
,
1143 fn GetMaxWidth() -> FLOAT
,
1144 fn GetMaxHeight() -> FLOAT
,
1145 fn GetFontCollection(
1146 currentPosition
: UINT32
,
1147 fontCollection
: *mut *mut IDWriteFontCollection
,
1148 textRange
: *mut DWRITE_TEXT_RANGE
,
1150 fn GetFontFamilyNameLength(
1151 currentPosition
: UINT32
,
1152 nameLength
: *mut UINT32
,
1153 textRange
: *mut DWRITE_TEXT_RANGE
,
1155 fn GetFontFamilyName(
1156 currentPosition
: UINT32
,
1157 fontFamilyName
: *mut WCHAR
,
1159 textRange
: *mut DWRITE_TEXT_RANGE
,
1162 currentPosition
: UINT32
,
1163 fontWeight
: *mut DWRITE_FONT_WEIGHT
,
1164 textRange
: *mut DWRITE_TEXT_RANGE
,
1167 currentPosition
: UINT32
,
1168 fontStyle
: *mut DWRITE_FONT_STYLE
,
1169 textRange
: *mut DWRITE_TEXT_RANGE
,
1172 currentPosition
: UINT32
,
1173 fontStretch
: *mut DWRITE_FONT_STRETCH
,
1174 textRange
: *mut DWRITE_TEXT_RANGE
,
1177 currentPosition
: UINT32
,
1178 fontSize
: *mut FLOAT
,
1179 textRange
: *mut DWRITE_TEXT_RANGE
,
1182 currentPosition
: UINT32
,
1183 hasUnderline
: *mut BOOL
,
1184 textRange
: *mut DWRITE_TEXT_RANGE
,
1186 fn GetStrikethrough(
1187 currentPosition
: UINT32
,
1188 hasStrikethrough
: *mut BOOL
,
1189 textRange
: *mut DWRITE_TEXT_RANGE
,
1191 fn GetDrawingEffect(
1192 currentPosition
: UINT32
,
1193 drawingEffect
: *mut *mut IUnknown
,
1194 textRange
: *mut DWRITE_TEXT_RANGE
,
1197 currentPosition
: UINT32
,
1198 inlineObject
: *mut *mut IDWriteInlineObject
,
1199 textRange
: *mut DWRITE_TEXT_RANGE
,
1202 currentPosition
: UINT32
,
1203 typography
: *mut *mut IDWriteTypography
,
1204 textRange
: *mut DWRITE_TEXT_RANGE
,
1206 fn GetLocaleNameLength(
1207 currentPosition
: UINT32
,
1208 nameLength
: *mut UINT32
,
1209 textRange
: *mut DWRITE_TEXT_RANGE
,
1212 currentPosition
: UINT32
,
1213 localeName
: *mut WCHAR
,
1215 textRange
: *mut DWRITE_TEXT_RANGE
,
1218 clientDrawingContext
: *mut c_void
,
1219 renderer
: *mut IDWriteTextRenderer
,
1224 lineMetrics
: *mut DWRITE_LINE_METRICS
,
1225 maxLineCount
: UINT32
,
1226 actualLineCount
: *mut UINT32
,
1229 textMetrics
: *mut DWRITE_TEXT_METRICS
,
1231 fn GetOverhangMetrics(
1232 overhangs
: *mut DWRITE_OVERHANG_METRICS
,
1234 fn GetClusterMetrics(
1235 clusterMetrics
: *mut DWRITE_CLUSTER_METRICS
,
1236 maxClusterCount
: UINT32
,
1237 actualClusterCount
: *mut UINT32
,
1239 fn DetermineMinWidth(
1240 minWidth
: *mut FLOAT
,
1245 isTrailingHit
: *mut BOOL
,
1246 isInside
: *mut BOOL
,
1247 hitTestMetrics
: *mut DWRITE_HIT_TEST_METRICS
,
1249 fn HitTestTextPosition(
1250 textPosition
: UINT32
,
1251 isTrailingHit
: BOOL
,
1254 hitTestMetrics
: *mut DWRITE_HIT_TEST_METRICS
,
1256 fn HitTestTextRange(
1257 textPosition
: UINT32
,
1261 hitTestMetrics
: *mut DWRITE_HIT_TEST_METRICS
,
1262 maxHitTestMetricsCount
: UINT32
,
1263 actualHitTestMetricsCount
: *mut UINT32
,
1266 RIDL
!{#[uuid(0x5e5a32a3, 0x8dff, 0x4773, 0x9f, 0xf6, 0x06, 0x96, 0xea, 0xb7, 0x72, 0x67)]
1267 interface
IDWriteBitmapRenderTarget(IDWriteBitmapRenderTargetVtbl
): IUnknown(IUnknownVtbl
) {
1269 baselineOriginX
: FLOAT
,
1270 baselineOriginY
: FLOAT
,
1271 measuringMode
: DWRITE_MEASURING_MODE
,
1272 glyphRun
: *const DWRITE_GLYPH_RUN
,
1273 renderingParams
: *mut IDWriteRenderingParams
,
1274 textColor
: COLORREF
,
1275 blackBoxRect
: *mut RECT
,
1277 fn GetMemoryDC() -> HDC
,
1278 fn GetPixelsPerDip() -> FLOAT
,
1280 pixelsPerDip
: FLOAT
,
1282 fn GetCurrentTransform(
1283 transform
: *mut DWRITE_MATRIX
,
1285 fn SetCurrentTransform(
1286 transform
: *const DWRITE_MATRIX
,
1296 RIDL
!{#[uuid(0x1edd9491, 0x9853, 0x4299, 0x89, 0x8f, 0x64, 0x32, 0x98, 0x3b, 0x6f, 0x3a)]
1297 interface
IDWriteGdiInterop(IDWriteGdiInteropVtbl
): IUnknown(IUnknownVtbl
) {
1298 fn CreateFontFromLOGFONT(
1299 logFont
: *const LOGFONTW
,
1300 font
: *mut *mut IDWriteFont
,
1302 fn ConvertFontToLOGFONT(
1303 font
: *mut IDWriteFont
,
1304 logFont
: *mut LOGFONTW
,
1305 isSystemFont
: *mut BOOL
,
1307 fn ConvertFontFaceToLOGFONT(
1308 font
: *mut IDWriteFontFace
,
1309 logFont
: *mut LOGFONTW
,
1311 fn CreateFontFaceFromHdc(
1313 fontFace
: *mut *mut IDWriteFontFace
,
1315 fn CreateBitmapRenderTarget(
1319 renderTarget
: *mut *mut IDWriteBitmapRenderTarget
,
1322 ENUM
!{enum DWRITE_TEXTURE_TYPE
{
1323 DWRITE_TEXTURE_ALIASED_1x1
= 0,
1324 DWRITE_TEXTURE_CLEARTYPE_3x1
= 1,
1326 pub const DWRITE_ALPHA_MAX
: BYTE
= 255;
1327 RIDL
!{#[uuid(0x7d97dbf7, 0xe085, 0x42d4, 0x81, 0xe3, 0x6a, 0x88, 0x3b, 0xde, 0xd1, 0x18)]
1328 interface
IDWriteGlyphRunAnalysis(IDWriteGlyphRunAnalysisVtbl
): IUnknown(IUnknownVtbl
) {
1329 fn GetAlphaTextureBounds(
1330 textureType
: DWRITE_TEXTURE_TYPE
,
1331 textureBounds
: *mut RECT
,
1333 fn CreateAlphaTexture(
1334 textureType
: DWRITE_TEXTURE_TYPE
,
1335 textureBounds
: *const RECT
,
1336 alphaValues
: *mut BYTE
,
1339 fn GetAlphaBlendParams(
1340 renderingParams
: *mut IDWriteRenderingParams
,
1341 blendGamma
: *mut FLOAT
,
1342 blendEnhancedContrast
: *mut FLOAT
,
1343 blendClearTypeLevel
: *mut FLOAT
,
1346 RIDL
!{#[uuid(0xb859ee5a, 0xd838, 0x4b5b, 0xa2, 0xe8, 0x1a, 0xdc, 0x7d, 0x93, 0xdb, 0x48)]
1347 interface
IDWriteFactory(IDWriteFactoryVtbl
): IUnknown(IUnknownVtbl
) {
1348 fn GetSystemFontCollection(
1349 fontCollection
: *mut *mut IDWriteFontCollection
,
1350 checkForUpdates
: BOOL
,
1352 fn CreateCustomFontCollection(
1353 collectionLoader
: *mut IDWriteFontCollectionLoader
,
1354 collectionKey
: *const c_void
,
1355 collectionKeySize
: UINT32
,
1356 fontCollection
: *mut *mut IDWriteFontCollection
,
1358 fn RegisterFontCollectionLoader(
1359 fontCollectionLoader
: *mut IDWriteFontCollectionLoader
,
1361 fn UnregisterFontCollectionLoader(
1362 fontCollectionLoader
: *mut IDWriteFontCollectionLoader
,
1364 fn CreateFontFileReference(
1365 filePath
: *const WCHAR
,
1366 lastWriteTime
: *const FILETIME
,
1367 fontFile
: *mut *mut IDWriteFontFile
,
1369 fn CreateCustomFontFileReference(
1370 fontFileReferenceKey
: *const c_void
,
1371 fontFileReferenceKeySize
: UINT32
,
1372 fontFileLoader
: *mut IDWriteFontFileLoader
,
1373 fontFile
: *mut *mut IDWriteFontFile
,
1376 fontFaceType
: DWRITE_FONT_FACE_TYPE
,
1377 numberOfFiles
: UINT32
,
1378 fontFiles
: *const *mut IDWriteFontFile
,
1380 fontFaceSimulationFlags
: DWRITE_FONT_SIMULATIONS
,
1381 fontFace
: *mut *mut IDWriteFontFace
,
1383 fn CreateRenderingParams(
1384 renderingParams
: *mut *mut IDWriteRenderingParams
,
1386 fn CreateMonitorRenderingParams(
1388 renderingParams
: *mut *mut IDWriteRenderingParams
,
1390 fn CreateCustomRenderingParams(
1392 enhancedContrast
: FLOAT
,
1393 clearTypeLevel
: FLOAT
,
1394 pixelGeometry
: DWRITE_PIXEL_GEOMETRY
,
1395 renderingMode
: DWRITE_RENDERING_MODE
,
1396 renderingParams
: *mut *mut IDWriteRenderingParams
,
1398 fn RegisterFontFileLoader(
1399 fontFileLoader
: *mut IDWriteFontFileLoader
,
1401 fn UnregisterFontFileLoader(
1402 fontFileLoader
: *mut IDWriteFontFileLoader
,
1404 fn CreateTextFormat(
1405 fontFamilyName
: *const WCHAR
,
1406 fontCollection
: *mut IDWriteFontCollection
,
1407 fontWeight
: DWRITE_FONT_WEIGHT
,
1408 fontStyle
: DWRITE_FONT_STYLE
,
1409 fontStretch
: DWRITE_FONT_STRETCH
,
1411 localeName
: *const WCHAR
,
1412 textFormat
: *mut *mut IDWriteTextFormat
,
1414 fn CreateTypography(
1415 typography
: *mut *mut IDWriteTypography
,
1418 gdiInterop
: *mut *mut IDWriteGdiInterop
,
1420 fn CreateTextLayout(
1421 string
: *const WCHAR
,
1422 stringLength
: UINT32
,
1423 textFormat
: *mut IDWriteTextFormat
,
1426 textLayout
: *mut *mut IDWriteTextLayout
,
1428 fn CreateGdiCompatibleTextLayout(
1429 string
: *const WCHAR
,
1430 stringLength
: UINT32
,
1431 textFormat
: *mut IDWriteTextFormat
,
1433 layoutHeight
: FLOAT
,
1434 pixelsPerDip
: FLOAT
,
1435 transform
: *const DWRITE_MATRIX
,
1436 useGdiNatrual
: BOOL
,
1437 textLayout
: *mut *mut IDWriteTextLayout
,
1439 fn CreateEllipsisTrimmingSign(
1440 textFormat
: *mut IDWriteTextFormat
,
1441 trimmingSign
: *mut *mut IDWriteInlineObject
,
1443 fn CreateTextAnalyzer(
1444 textAnalyzer
: *mut *mut IDWriteTextAnalyzer
,
1446 fn CreateNumberSubstitution(
1447 substitutionMethod
: DWRITE_NUMBER_SUBSTITUTION_METHOD
,
1448 localeName
: *const WCHAR
,
1449 ignoreUserOverride
: BOOL
,
1450 numberSubstitution
: *mut *mut IDWriteNumberSubstitution
,
1452 fn CreateGlyphRunAnalysis(
1453 glyphRun
: *const DWRITE_GLYPH_RUN
,
1454 pixelsPerDip
: FLOAT
,
1455 transform
: *const DWRITE_MATRIX
,
1456 renderingMode
: DWRITE_RENDERING_MODE
,
1457 measuringMode
: DWRITE_MEASURING_MODE
,
1458 baselineOriginX
: FLOAT
,
1459 baselineOriginY
: FLOAT
,
1460 glyphRunAnalysis
: *mut *mut IDWriteGlyphRunAnalysis
,
1463 pub const FACILITY_DWRITE
: HRESULT
= 0x898;
1464 pub const DWRITE_ERR_BASE
: HRESULT
= 0x5000;
1466 pub fn MAKE_DWRITE_HR(severity
: HRESULT
, code
: HRESULT
) -> HRESULT
{
1467 MAKE_HRESULT
!(severity
, FACILITY_DWRITE
, DWRITE_ERR_BASE
+ code
)
1470 pub fn MAKE_DWRITE_HR_ERR(code
: HRESULT
) -> HRESULT
{
1471 MAKE_DWRITE_HR(SEVERITY_ERROR
, code
)
1474 pub fn DWriteCreateFactory(
1475 factoryType
: DWRITE_FACTORY_TYPE
, iid
: REFIID
, factory
: *mut *mut IUnknown
,