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.
7 use ctypes::c_void;
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,
28 }}
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,
39 }}
40 ENUM!{enum DWRITE_FONT_SIMULATIONS {
41 DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
42 DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
43 DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002,
44 }}
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,
63 }}
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,
76 }}
77 ENUM!{enum DWRITE_FONT_STYLE {
78 DWRITE_FONT_STYLE_NORMAL,
79 DWRITE_FONT_STYLE_OBLIQUE,
80 DWRITE_FONT_STYLE_ITALIC,
81 }}
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,
105 }}
106 STRUCT!{struct DWRITE_FONT_METRICS {
107 designUnitsPerEm: UINT16,
108 ascent: UINT16,
109 descent: UINT16,
110 lineGap: INT16,
111 capHeight: UINT16,
112 xHeight: UINT16,
113 underlinePosition: INT16,
114 underlineThickness: UINT16,
115 strikethroughPosition: INT16,
116 strikethroughThickness: UINT16,
117 }}
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,
126 }}
127 STRUCT!{struct DWRITE_GLYPH_OFFSET {
128 advanceOffset: FLOAT,
129 ascenderOffset: FLOAT,
130 }}
131 ENUM!{enum DWRITE_FACTORY_TYPE {
132 DWRITE_FACTORY_TYPE_SHARED,
133 DWRITE_FACTORY_TYPE_ISOLATED,
134 }}
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,
141 ) -> HRESULT,
142 }}
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,
150 ) -> HRESULT,
151 fn GetFilePathFromKey(
152 fontFileReferenceKey: *const c_void,
153 fontFileReferenceKeySize: UINT32,
154 filePath: *mut WCHAR,
155 filePathSize: UINT32,
156 ) -> HRESULT,
157 fn GetLastWriteTimeFromKey(
158 fontFileReferenceKey: *const c_void,
159 fontFileReferenceKeySize: UINT32,
160 lastWriteTime: *mut FILETIME,
161 ) -> HRESULT,
162 }}
163 RIDL!{#[uuid(0x6d4865fe, 0x0ab8, 0x4d91, 0x8f, 0x62, 0x5d, 0xd6, 0xbe, 0x34, 0xa3, 0xe0)]
164 interface IDWriteFontFileStream(IDWriteFontFileStreamVtbl): IUnknown(IUnknownVtbl) {
165 fn ReadFileFragment(
166 fragmentStart: *mut *const c_void,
167 fileOffset: UINT64,
168 fragmentSize: UINT64,
169 fragmentContext: *mut *mut c_void,
170 ) -> HRESULT,
171 fn ReleaseFileFragment(
172 fragmentContext: *mut c_void,
173 ) -> (),
174 fn GetFileSize(
175 fileSize: *mut UINT64,
176 ) -> HRESULT,
177 fn GetLastWriteTime(
178 lastWriteTime: *mut UINT64,
179 ) -> HRESULT,
180 }}
181 ENUM!{enum DWRITE_OUTLINE_THRESHOLD {
182 DWRITE_OUTLINE_THRESHOLD_ANTIALIASED,
183 DWRITE_OUTLINE_THRESHOLD_ALIASED,
184 }}
185 STRUCT!{struct DWRITE_FONT_METRICS1 {
186 designUnitsPerEm: UINT16,
187 ascent: UINT16,
188 descent: UINT16,
189 lineGap: INT16,
190 capHeight: UINT16,
191 xHeight: UINT16,
192 underlinePosition: INT16,
193 underlineThickness: UINT16,
194 strikethroughPosition: INT16,
195 strikethroughThickness: UINT16,
196 glyphBoxLeft: INT16,
197 glyphBoxTop: INT16,
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,
209 }}
210 STRUCT!{struct DWRITE_UNICODE_RANGE {
211 first: UINT32,
212 last: UINT32,
213 }}
214 STRUCT!{struct DWRITE_CARET_METRICS {
215 slopeRise: INT16,
216 slopeRun: INT16,
217 offset: INT16,
218 }}
219 #[inline]
DWRITE_MAKE_OPENTYPE_TAG(a: u8, b: u8, c: u8, d: u8) -> u32220 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)
222 }
223 RIDL!{#[uuid(0x739d886a, 0xcef5, 0x47dc, 0x87, 0x69, 0x1a, 0x8b, 0x41, 0xbe, 0xbb, 0xb0)]
224 interface IDWriteFontFile(IDWriteFontFileVtbl): IUnknown(IUnknownVtbl) {
225 fn GetReferenceKey(
226 fontFileReferenceKey: *mut *const c_void,
227 fontFileReferenceKeySize: *mut UINT32,
228 ) -> HRESULT,
229 fn GetLoader(
230 fontFileLoader: *mut *mut IDWriteFontFileLoader,
231 ) -> HRESULT,
232 fn Analyze(
233 isSupportedFontType: *mut BOOL,
234 fontFileType: *mut DWRITE_FONT_FILE_TYPE,
235 fontFaceType: *mut DWRITE_FONT_FACE_TYPE,
236 numberOfFaces: *mut UINT32,
237 ) -> HRESULT,
238 }}
239 ENUM!{enum DWRITE_PIXEL_GEOMETRY {
240 DWRITE_PIXEL_GEOMETRY_FLAT,
241 DWRITE_PIXEL_GEOMETRY_RGB,
242 DWRITE_PIXEL_GEOMETRY_BGR,
243 }}
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,
256 }}
257 STRUCT!{struct DWRITE_MATRIX {
258 m11: FLOAT,
259 m12: FLOAT,
260 m21: FLOAT,
261 m22: FLOAT,
262 dx: FLOAT,
263 dy: FLOAT,
264 }}
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,
272 }}
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,
277 fn GetFiles(
278 numberOfFiles: *mut UINT32,
279 fontFiles: *mut *mut IDWriteFontFile,
280 ) -> HRESULT,
281 fn GetIndex() -> UINT32,
282 fn GetSimulations() -> DWRITE_FONT_SIMULATIONS,
283 fn IsSymbolFont() -> BOOL,
284 fn GetMetrics(
285 fontFaceMetrics: *mut DWRITE_FONT_METRICS,
286 ) -> (),
287 fn GetGlyphCount() -> UINT16,
288 fn GetDesignGlyphMetrics(
289 glyphIndices: *const UINT16,
290 glyphCount: UINT32,
291 glyphMetrics: *mut DWRITE_GLYPH_METRICS,
292 isSideways: BOOL,
293 ) -> HRESULT,
294 fn GetGlyphIndices(
295 codePoints: *const UINT32,
296 codePointCount: UINT32,
297 glyphIndices: *mut UINT16,
298 ) -> HRESULT,
299 fn TryGetFontTable(
300 openTypeTableTag: UINT32,
301 tableData: *mut *const c_void,
302 tableSize: *mut UINT32,
303 tableContext: *mut *mut c_void,
304 exists: *mut BOOL,
305 ) -> HRESULT,
306 fn ReleaseFontTable(
307 tableContext: *mut c_void,
308 ) -> HRESULT,
309 fn GetGlyphRunOutline(
310 emSize: FLOAT,
311 glyphIndices: *const UINT16,
312 glyphAdvances: *const FLOAT,
313 glyphOffsets: *const DWRITE_GLYPH_OFFSET,
314 glyphCount: UINT32,
315 isSideways: BOOL,
316 isRightToLeft: BOOL,
317 geometrySink: *mut IDWriteGeometrySink,
318 ) -> HRESULT,
319 fn GetRecommendedRenderingMode(
320 emSize: FLOAT,
321 pixelsPerDip: FLOAT,
322 measuringMode: DWRITE_MEASURING_MODE,
323 renderingParams: *mut IDWriteRenderingParams,
324 renderingMode: *mut DWRITE_RENDERING_MODE,
325 ) -> HRESULT,
326 fn GetGdiCompatibleMetrics(
327 emSize: FLOAT,
328 pixelsPerDip: FLOAT,
329 transform: *const DWRITE_MATRIX,
330 fontFaceMetrics: *mut DWRITE_FONT_METRICS,
331 ) -> HRESULT,
332 fn GetGdiCompatibleGlyphMetrics(
333 enSize: FLOAT,
334 pixelsPerDip: FLOAT,
335 transform: *const DWRITE_MATRIX,
336 useGdiNatrual: BOOL,
337 glyphIndices: *const UINT16,
338 glyphCount: UINT32,
339 glyphMetrics: *mut DWRITE_GLYPH_METRICS,
340 isSideways: BOOL,
341 ) -> HRESULT,
342 }}
343 RIDL!{#[uuid(0xa71efdb4, 0x9fdb, 0x4838, 0xad, 0x90, 0xcf, 0xc3, 0xbe, 0x8c, 0x3d, 0xaf)]
344 interface IDWriteFontFace1(IDWriteFontFace1Vtbl): IDWriteFontFace(IDWriteFontFaceVtbl) {
345 fn GetMetrics(
346 fontFaceMetrics: *mut DWRITE_FONT_METRICS1,
347 ) -> (),
348 fn GetGdiCompatibleMetrics(
349 emSize: FLOAT,
350 pixelsPerDip: FLOAT,
351 transform: *const DWRITE_MATRIX,
352 fontFaceMetrics: *mut DWRITE_FONT_METRICS1,
353 ) -> HRESULT,
354 fn GetCaretMetrics(
355 caretMetrics: *mut DWRITE_CARET_METRICS,
356 ) -> (),
357 fn GetUnicodeRanges(
358 maxRangeCount: UINT32,
359 unicodeRanges: *mut DWRITE_UNICODE_RANGE,
360 actualRangeCount: *mut UINT32,
361 ) -> HRESULT,
362 fn IsMonoSpacedFont() -> BOOL,
363 fn GetDesignGlyphAdvances(
364 glyphCount: UINT32,
365 glyphIndices: *const UINT16,
366 glyphAdvances: *mut INT32,
367 isSideways: BOOL,
368 ) -> HRESULT,
369 fn GetGdiCompatibleGlyphAdvance(
370 emSize: FLOAT,
371 pixelsPerDip: FLOAT,
372 transform: *const DWRITE_MATRIX,
373 useGdiNatural: BOOL,
374 isSideways: BOOL,
375 glyphCount: UINT32,
376 glyphIndices: *const UINT16,
377 glyphAdvances: *mut INT32,
378 ) -> HRESULT,
379 fn GetKerningPairAdjustments(
380 glyphCount: UINT32,
381 glyphIndices: *const UINT16,
382 glyphAdvanceAdjustments: *mut INT32,
383 ) -> HRESULT,
384 fn HasKerningPairs() -> BOOL,
385 fn GetRecommendedRenderingMode(
386 fontEmSize: FLOAT,
387 dpiX: FLOAT,
388 dpiY: FLOAT,
389 transform: *const DWRITE_MATRIX,
390 isSideways: BOOL,
391 outlineThreshold: DWRITE_OUTLINE_THRESHOLD,
392 measuringMode: DWRITE_MEASURING_MODE,
393 renderingMode: *mut DWRITE_RENDERING_MODE,
394 ) -> HRESULT,
395 fn GetVerticalGlyphVariants(
396 nominalGlyphIndices: *const UINT16,
397 verticalGlyphIndices: *mut UINT16,
398 ) -> HRESULT,
399 fn HasVerticalGlyphVariants() -> BOOL,
400 }}
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,
409 ) -> HRESULT,
410 }}
411 RIDL!{#[uuid(0x72755049, 0x5ff7, 0x435d, 0x83, 0x48, 0x4b, 0xe9, 0x7c, 0xfa, 0x6c, 0x7c)]
412 interface IDWriteFontFileEnumerator(IDWriteFontFileEnumeratorVtbl): IUnknown(IUnknownVtbl) {
413 fn MoveNext(
414 hasCurrentFile: *mut BOOL,
415 ) -> HRESULT,
416 fn GetCurrentFontFile(
417 fontFile: *mut *mut IDWriteFontFile,
418 ) -> HRESULT,
419 }}
420 RIDL!{#[uuid(0x08256209, 0x099a, 0x4b34, 0xb8, 0x6d, 0xc2, 0x2b, 0x11, 0x0e, 0x77, 0x71)]
421 interface IDWriteLocalizedStrings(IDWriteLocalizedStringsVtbl): IUnknown(IUnknownVtbl) {
422 fn GetCount() -> UINT32,
423 fn FindLocaleName(
424 localeName: *const WCHAR,
425 index: *mut UINT32,
426 exists: *mut BOOL,
427 ) -> HRESULT,
428 fn GetLocaleNameLength(
429 index: UINT32,
430 length: *mut UINT32,
431 ) -> HRESULT,
432 fn GetLocaleName(
433 index: UINT32,
434 localeName: *mut WCHAR,
435 size: UINT32,
436 ) -> HRESULT,
437 fn GetStringLength(
438 index: UINT32,
439 length: *mut UINT32,
440 ) -> HRESULT,
441 fn GetString(
442 index: UINT32,
443 stringBuffer: *mut WCHAR,
444 size: UINT32,
445 ) -> HRESULT,
446 }}
447 RIDL!{#[uuid(0xa84cee02, 0x3eea, 0x4eee, 0xa8, 0x27, 0x87, 0xc1, 0xa0, 0x2a, 0x0f, 0xcc)]
448 interface IDWriteFontCollection(IDWriteFontCollectionVtbl): IUnknown(IUnknownVtbl) {
449 fn GetFontFamilyCount() -> UINT32,
450 fn GetFontFamily(
451 index: UINT32,
452 fontFamily: *mut *mut IDWriteFontFamily,
453 ) -> HRESULT,
454 fn FindFamilyName(
455 familyName: *const WCHAR,
456 index: *mut UINT32,
457 exists: *mut BOOL,
458 ) -> HRESULT,
459 fn GetFontFromFontFace(
460 fontFace: *mut IDWriteFontFace,
461 font: *mut *mut IDWriteFont,
462 ) -> HRESULT,
463 }}
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,
468 ) -> HRESULT,
469 fn GetFontCount() -> UINT32,
470 fn GetFont(
471 index: UINT32,
472 font: *mut *mut IDWriteFont,
473 ) -> HRESULT,
474 }}
475 RIDL!{#[uuid(0xda20d8ef, 0x812a, 0x4c43, 0x98, 0x02, 0x62, 0xec, 0x4a, 0xbd, 0x7a, 0xdd)]
476 interface IDWriteFontFamily(IDWriteFontFamilyVtbl): IDWriteFontList(IDWriteFontListVtbl) {
477 fn GetFamilyNames(
478 names: *mut *mut IDWriteLocalizedStrings,
479 ) -> HRESULT,
480 fn GetFirstMatchingFont(
481 weight: DWRITE_FONT_WEIGHT,
482 stretch: DWRITE_FONT_STRETCH,
483 style: DWRITE_FONT_STYLE,
484 matchingFont: *mut *mut IDWriteFont,
485 ) -> HRESULT,
486 fn GetMatchingFonts(
487 weight: DWRITE_FONT_WEIGHT,
488 stretch: DWRITE_FONT_STRETCH,
489 style: DWRITE_FONT_STYLE,
490 matchingFonts: *mut *mut IDWriteFontList,
491 ) -> HRESULT,
492 }}
493 RIDL!{#[uuid(0xacd16696, 0x8c14, 0x4f5d, 0x87, 0x7e, 0xfe, 0x3f, 0xc1, 0xd3, 0x27, 0x37)]
494 interface IDWriteFont(IDWriteFontVtbl): IUnknown(IUnknownVtbl) {
495 fn GetFontFamily(
496 fontFamily: *mut *mut IDWriteFontFamily,
497 ) -> HRESULT,
498 fn GetWeight() -> DWRITE_FONT_WEIGHT,
499 fn GetStretch() -> DWRITE_FONT_STRETCH,
500 fn GetStyle() -> DWRITE_FONT_STYLE,
501 fn IsSymbolFont() -> BOOL,
502 fn GetFaceNames(
503 names: *mut *mut IDWriteLocalizedStrings,
504 ) -> HRESULT,
505 fn GetInformationalStrings(
506 informationalStringId: DWRITE_INFORMATIONAL_STRING_ID,
507 informationalStrings: *mut *mut IDWriteLocalizedStrings,
508 exists: *mut BOOL,
509 ) -> HRESULT,
510 fn GetSimulations() -> DWRITE_FONT_SIMULATIONS,
511 fn GetMetrics(
512 fontMetrics: *mut DWRITE_FONT_METRICS,
513 ) -> (),
514 fn HasCharacter(
515 unicodeValue: UINT32,
516 exists: *mut BOOL,
517 ) -> HRESULT,
518 fn CreateFontFace(
519 fontFace: *mut *mut IDWriteFontFace,
520 ) -> HRESULT,
521 }}
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,
527 }}
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,
533 }}
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,
539 }}
540 ENUM!{enum DWRITE_PARAGRAPH_ALIGNMENT {
541 DWRITE_PARAGRAPH_ALIGNMENT_NEAR,
542 DWRITE_PARAGRAPH_ALIGNMENT_FAR,
543 DWRITE_PARAGRAPH_ALIGNMENT_CENTER,
544 }}
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,
551 }}
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,
556 }}
557 ENUM!{enum DWRITE_TRIMMING_GRANULARITY {
558 DWRITE_TRIMMING_GRANULARITY_NONE,
559 DWRITE_TRIMMING_GRANULARITY_CHARACTER,
560 DWRITE_TRIMMING_GRANULARITY_WORD,
561 }}
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'
644 }}
645 STRUCT!{struct DWRITE_TEXT_RANGE {
646 startPosition: UINT32,
647 length: UINT32,
648 }}
649 STRUCT!{struct DWRITE_FONT_FEATURE {
650 nameTag: DWRITE_FONT_FEATURE_TAG,
651 parameter: UINT32,
652 }}
653 STRUCT!{struct DWRITE_TYPOGRAPHIC_FEATURES {
654 features: *mut DWRITE_FONT_FEATURE,
655 featureCount: UINT32,
656 }}
657 STRUCT!{struct DWRITE_TRIMMING {
658 granularity: DWRITE_TRIMMING_GRANULARITY,
659 delimiter: UINT32,
660 delimiterCount: UINT32,
661 }}
662 RIDL!{#[uuid(0x9c906818, 0x31d7, 0x4fd3, 0xa1, 0x51, 0x7c, 0x5e, 0x22, 0x5d, 0xb5, 0x5a)]
663 interface IDWriteTextFormat(IDWriteTextFormatVtbl): IUnknown(IUnknownVtbl) {
664 fn SetTextAlignment(
665 textAlignment: DWRITE_TEXT_ALIGNMENT,
666 ) -> HRESULT,
667 fn SetParagraphAlignment(
668 paragraphAlignment: DWRITE_PARAGRAPH_ALIGNMENT,
669 ) -> HRESULT,
670 fn SetWordWrapping(
671 wordWrapping: DWRITE_WORD_WRAPPING,
672 ) -> HRESULT,
673 fn SetReadingDirection(
674 readingDirection: DWRITE_READING_DIRECTION,
675 ) -> HRESULT,
676 fn SetFlowDirection(
677 flowDirection: DWRITE_FLOW_DIRECTION,
678 ) -> HRESULT,
679 fn SetIncrementalTabStop(
680 incrementalTabStop: FLOAT,
681 ) -> HRESULT,
682 fn SetTrimming(
683 trimmingOptions: *const DWRITE_TRIMMING,
684 trimmingSign: *mut IDWriteInlineObject,
685 ) -> HRESULT,
686 fn SetLineSpacing(
687 lineSpacingMethod: DWRITE_LINE_SPACING_METHOD,
688 lineSpacing: FLOAT,
689 baseLine: FLOAT,
690 ) -> HRESULT,
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,
697 fn GetTrimming(
698 trimmingOptions: *mut DWRITE_TRIMMING,
699 trimmingSign: *mut *mut IDWriteInlineObject,
700 ) -> HRESULT,
701 fn GetLineSpacing(
702 lineSpacingMethod: *mut DWRITE_LINE_SPACING_METHOD,
703 lineSpacing: *mut FLOAT,
704 baseline: *mut FLOAT,
705 ) -> HRESULT,
706 fn GetFontCollection(
707 fontCollection: *mut *mut IDWriteFontCollection,
708 ) -> HRESULT,
709 fn GetFontFamilyNameLength() -> UINT32,
710 fn GetFontFamilyName(
711 fontFamilyName: *mut WCHAR,
712 nameSize: UINT32,
713 ) -> HRESULT,
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,
719 fn GetLocaleName(
720 localeName: *mut WCHAR,
721 nameSize: UINT32,
722 ) -> HRESULT,
723 }}
724 RIDL!{#[uuid(0x55f1112b, 0x1dc2, 0x4b3c, 0x95, 0x41, 0xf4, 0x68, 0x94, 0xed, 0x85, 0xb6)]
725 interface IDWriteTypography(IDWriteTypographyVtbl): IUnknown(IUnknownVtbl) {
726 fn AddFontFeature(
727 fontFeature: DWRITE_FONT_FEATURE,
728 ) -> HRESULT,
729 fn GetFontFeatureCount() -> UINT32,
730 fn GetFontFeature(
731 fontFeatureIndex: UINT32,
732 fontFeature: *mut DWRITE_FONT_FEATURE,
733 ) -> HRESULT,
734 }}
735 ENUM!{enum DWRITE_SCRIPT_SHAPES {
736 DWRITE_SCRIPT_SHAPES_DEFAULT = 0,
737 DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1,
738 }}
739 STRUCT!{struct DWRITE_SCRIPT_ANALYSIS {
740 script: UINT16,
741 shapes: DWRITE_SCRIPT_SHAPES,
742 }}
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,
748 }}
749 STRUCT!{struct DWRITE_LINE_BREAKPOINT {
750 bit_fields: UINT8,
751 }}
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],
758 ]}
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,
765 }}
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 {
769 bit_fields: UINT16,
770 }}
771 BITFIELD!{DWRITE_SHAPING_TEXT_PROPERTIES bit_fields: UINT16 [
772 isShapedAlone set_isShapedAlone[0..1],
773 reserved set_reserved[1..16],
774 ]}
775 STRUCT!{struct DWRITE_SHAPING_GLYPH_PROPERTIES {
776 bit_fields: UINT16,
777 }}
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],
784 ]}
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,
791 ) -> HRESULT,
792 fn GetTextBeforePosition(
793 textPosition: UINT32,
794 textString: *mut *const WCHAR,
795 textLength: *mut UINT32,
796 ) -> HRESULT,
797 fn GetParagraphReadingDirection() -> DWRITE_READING_DIRECTION,
798 fn GetLocaleName(
799 textPosition: UINT32,
800 textLength: *mut UINT32,
801 localeName: *mut *const WCHAR,
802 ) -> HRESULT,
803 fn GetNumberSubstitution(
804 textPosition: UINT32,
805 textLength: *mut UINT32,
806 numberSubstitution: *mut *mut IDWriteNumberSubstitution,
807 ) -> HRESULT,
808 }}
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,
813 textLength: UINT32,
814 scriptAnalysis: *const DWRITE_SCRIPT_ANALYSIS,
815 ) -> HRESULT,
816 fn SetLineBreakpoints(
817 textPosition: UINT32,
818 textLength: UINT32,
819 lineBreakpoints: *const DWRITE_LINE_BREAKPOINT,
820 ) -> HRESULT,
821 fn SetBidiLevel(
822 textPosition: UINT32,
823 textLength: UINT32,
824 explicitLevel: UINT8,
825 resolvedLevel: UINT8,
826 ) -> HRESULT,
827 fn SetNumberSubstitution(
828 textPosition: UINT32,
829 textLength: UINT32,
830 numberSubstitution: *mut IDWriteNumberSubstitution,
831 ) -> HRESULT,
832 }}
833 RIDL!{#[uuid(0xb7e6163e, 0x7f46, 0x43b4, 0x84, 0xb3, 0xe4, 0xe6, 0x24, 0x9c, 0x36, 0x5d)]
834 interface IDWriteTextAnalyzer(IDWriteTextAnalyzerVtbl): IUnknown(IUnknownVtbl) {
835 fn AnalyzeScript(
836 analysisSource: *mut IDWriteTextAnalysisSource,
837 textPosition: UINT32,
838 textLength: UINT32,
839 analysisSink: *mut IDWriteTextAnalysisSink,
840 ) -> HRESULT,
841 fn AnalyzeBidi(
842 analysisSource: *mut IDWriteTextAnalysisSource,
843 textPosition: UINT32,
844 textLength: UINT32,
845 analysisSink: *mut IDWriteTextAnalysisSink,
846 ) -> HRESULT,
847 fn AnalyzeNumberSubstitution(
848 analysisSource: *mut IDWriteTextAnalysisSource,
849 textPosition: UINT32,
850 textLength: UINT32,
851 analysisSink: *mut IDWriteTextAnalysisSink,
852 ) -> HRESULT,
853 fn AnalyzeLineBreakpoints(
854 analysisSource: *mut IDWriteTextAnalysisSource,
855 textPosition: UINT32,
856 textLength: UINT32,
857 analysisSink: *mut IDWriteTextAnalysisSink,
858 ) -> HRESULT,
859 fn GetGlyphs(
860 textString: *const WCHAR,
861 textLength: UINT32,
862 fontFace: *mut IDWriteFontFace,
863 isSideways: BOOL,
864 isRightToLeft: BOOL,
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,
877 ) -> HRESULT,
878 fn GetGlyphPlacements(
879 textString: *const WCHAR,
880 clusterMap: *const UINT16,
881 textProps: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
882 textLength: UINT32,
883 glyphIndices: *const UINT16,
884 glyphProps: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
885 glyphCount: UINT32,
886 fontFace: *mut IDWriteFontFace,
887 fontEmSize: FLOAT,
888 isSideways: BOOL,
889 isRightToLeft: BOOL,
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,
897 ) -> HRESULT,
898 fn GetGdiCompatibleGlyphPlacements(
899 textString: *const WCHAR,
900 clusterMap: *const UINT16,
901 textProps: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
902 textLength: UINT32,
903 glyphIndices: *const UINT16,
904 glyphProps: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
905 glyphCount: UINT32,
906 fontFace: *mut IDWriteFontFace,
907 fontEmSize: FLOAT,
908 pixelsPerDip: FLOAT,
909 transform: *const DWRITE_MATRIX,
910 useGdiNatrual: BOOL,
911 isSideways: BOOL,
912 isRightToLeft: BOOL,
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,
920 ) -> HRESULT,
921 }}
922 STRUCT!{struct DWRITE_GLYPH_RUN {
923 fontFace: *mut IDWriteFontFace,
924 fontEmSize: FLOAT,
925 glyphCount: UINT32,
926 glyphIndices: *const UINT16,
927 glyphAdvances: *const FLOAT,
928 glyphOffsets: *const DWRITE_GLYPH_OFFSET,
929 isSideways: BOOL,
930 bidiLevel: UINT32,
931 }}
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,
938 }}
939 STRUCT!{struct DWRITE_UNDERLINE {
940 width: FLOAT,
941 thickness: FLOAT,
942 offset: FLOAT,
943 runHeight: FLOAT,
944 readingDirection: DWRITE_READING_DIRECTION,
945 flowDirection: DWRITE_FLOW_DIRECTION,
946 localeName: *const WCHAR,
947 measuringMode: DWRITE_MEASURING_MODE,
948 }}
949 STRUCT!{struct DWRITE_STRIKETHROUGH {
950 width: FLOAT,
951 thickness: FLOAT,
952 offset: FLOAT,
953 readingDirection: DWRITE_READING_DIRECTION,
954 flowDirection: DWRITE_FLOW_DIRECTION,
955 localeName: *const WCHAR,
956 measuringMode: DWRITE_MEASURING_MODE,
957 }}
958 STRUCT!{struct DWRITE_LINE_METRICS {
959 length: UINT32,
960 trailingWhitespaceLength: UINT32,
961 newlineLength: UINT32,
962 height: FLOAT,
963 baseline: FLOAT,
964 isTrimmed: BOOL,
965 }}
966 STRUCT!{struct DWRITE_CLUSTER_METRICS {
967 width: FLOAT,
968 length: UINT16,
969 bit_fields: UINT16,
970 }}
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],
978 ]}
979 STRUCT!{struct DWRITE_TEXT_METRICS {
980 left: FLOAT,
981 top: FLOAT,
982 width: FLOAT,
983 widthIncludingTrailingWhitespace: FLOAT,
984 height: FLOAT,
985 layoutWidth: FLOAT,
986 layoutHeight: FLOAT,
987 maxBidiReorderingDepth: UINT32,
988 lineCount: UINT32,
989 }}
990 STRUCT!{struct DWRITE_INLINE_OBJECT_METRICS {
991 width: FLOAT,
992 height: FLOAT,
993 baseline: FLOAT,
994 supportsSideways: BOOL,
995 }}
996 STRUCT!{struct DWRITE_OVERHANG_METRICS {
997 left: FLOAT,
998 top: FLOAT,
999 right: FLOAT,
1000 bottom: FLOAT,
1001 }}
1002 STRUCT!{struct DWRITE_HIT_TEST_METRICS {
1003 textPosition: UINT32,
1004 length: UINT32,
1005 left: FLOAT,
1006 top: FLOAT,
1007 width: FLOAT,
1008 height: FLOAT,
1009 bidiLevel: UINT32,
1010 isText: BOOL,
1011 isTrimmed: BOOL,
1012 }}
1013 RIDL!{#[uuid(0x8339fde3, 0x106f, 0x47ab, 0x83, 0x73, 0x1c, 0x62, 0x95, 0xeb, 0x10, 0xb3)]
1014 interface IDWriteInlineObject(IDWriteInlineObjectVtbl): IUnknown(IUnknownVtbl) {
1015 fn Draw(
1016 clientDrawingContext: *mut c_void,
1017 renderer: *mut IDWriteTextRenderer,
1018 originX: FLOAT,
1019 originY: FLOAT,
1020 isSideways: BOOL,
1021 isRightToLeft: BOOL,
1022 clientDrawingEffect: *mut IUnknown,
1023 ) -> HRESULT,
1024 fn GetMetrics(
1025 metrics: *mut DWRITE_INLINE_OBJECT_METRICS,
1026 ) -> HRESULT,
1027 fn GetOverhangMetrics(
1028 overhangs: *mut DWRITE_OVERHANG_METRICS,
1029 ) -> HRESULT,
1030 fn GetBreakConditions(
1031 breakConditionBefore: *mut DWRITE_BREAK_CONDITION,
1032 breakConditionAfter: *mut DWRITE_BREAK_CONDITION,
1033 ) -> HRESULT,
1034 }}
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,
1040 ) -> HRESULT,
1041 fn GetCurrentTransform(
1042 clientDrawingContext: *mut c_void,
1043 transform: *mut DWRITE_MATRIX,
1044 ) -> HRESULT,
1045 fn GetPixelsPerDip(
1046 clientDrawingContext: *mut c_void,
1047 pixelsPerDip: *mut FLOAT,
1048 ) -> HRESULT,
1049 }}
1050 RIDL!{#[uuid(0xef8a8135, 0x5cc6, 0x45fe, 0x88, 0x25, 0xc5, 0xa0, 0x72, 0x4e, 0xb8, 0x19)]
1051 interface IDWriteTextRenderer(IDWriteTextRendererVtbl):
1052 IDWritePixelSnapping(IDWritePixelSnappingVtbl) {
1053 fn DrawGlyphRun(
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,
1061 ) -> HRESULT,
1062 fn DrawUnderline(
1063 clientDrawingContext: *mut c_void,
1064 baselineOriginX: FLOAT,
1065 baselineOriginY: FLOAT,
1066 underline: *const DWRITE_UNDERLINE,
1067 clientDrawingEffect: *mut IUnknown,
1068 ) -> HRESULT,
1069 fn DrawStrikethrough(
1070 clientDrawingContext: *mut c_void,
1071 baselineOriginX: FLOAT,
1072 baselineOriginY: FLOAT,
1073 strikethrough: *const DWRITE_STRIKETHROUGH,
1074 clientDrawingEffect: *mut IUnknown,
1075 ) -> HRESULT,
1076 fn DrawInlineObject(
1077 clientDrawingContext: *mut c_void,
1078 baselineOriginX: FLOAT,
1079 baselineOriginY: FLOAT,
1080 inlineObject: *mut IDWriteInlineObject,
1081 isSideways: BOOL,
1082 isRightToLeft: BOOL,
1083 clientDrawingEffect: *mut IUnknown,
1084 ) -> HRESULT,
1085 }}
1086 RIDL!{#[uuid(0x53737037, 0x6d14, 0x410b, 0x9b, 0xfe, 0x0b, 0x18, 0x2b, 0xb7, 0x09, 0x61)]
1087 interface IDWriteTextLayout(IDWriteTextLayoutVtbl):
1088 IDWriteTextFormat(IDWriteTextFormatVtbl) {
1089 fn SetMaxWidth(
1090 maxWidth: FLOAT,
1091 ) -> HRESULT,
1092 fn SetMaxHeight(
1093 maxHeight: FLOAT,
1094 ) -> HRESULT,
1095 fn SetFontCollection(
1096 fontCollection: *mut IDWriteFontCollection,
1097 textRange: DWRITE_TEXT_RANGE,
1098 ) -> HRESULT,
1099 fn SetFontFamilyName(
1100 fontFamilyName: *const WCHAR,
1101 textRange: DWRITE_TEXT_RANGE,
1102 ) -> HRESULT,
1103 fn SetFontWeight(
1104 fontWeight: DWRITE_FONT_WEIGHT,
1105 textRange: DWRITE_TEXT_RANGE,
1106 ) -> HRESULT,
1107 fn SetFontStyle(
1108 fontStyle: DWRITE_FONT_STYLE,
1109 textRange: DWRITE_TEXT_RANGE,
1110 ) -> HRESULT,
1111 fn SetFontStretch(
1112 fontStretch: DWRITE_FONT_STRETCH,
1113 textRange: DWRITE_TEXT_RANGE,
1114 ) -> HRESULT,
1115 fn SetFontSize(
1116 fontSize: FLOAT,
1117 textRange: DWRITE_TEXT_RANGE,
1118 ) -> HRESULT,
1119 fn SetUnderline(
1120 hasUnderline: BOOL,
1121 textRange: DWRITE_TEXT_RANGE,
1122 ) -> HRESULT,
1123 fn SetStrikethrough(
1124 hasStrikethrough: BOOL,
1125 textRange: DWRITE_TEXT_RANGE,
1126 ) -> HRESULT,
1127 fn SetDrawingEffect(
1128 drawingEffect: *mut IUnknown,
1129 textRange: DWRITE_TEXT_RANGE,
1130 ) -> HRESULT,
1131 fn SetInlineObject(
1132 inlineObject: *mut IDWriteInlineObject,
1133 textRange: DWRITE_TEXT_RANGE,
1134 ) -> HRESULT,
1135 fn SetTypography(
1136 typography: *mut IDWriteTypography,
1137 textRange: DWRITE_TEXT_RANGE,
1138 ) -> HRESULT,
1139 fn SetLocaleName(
1140 localeName: *const WCHAR,
1141 textRange: DWRITE_TEXT_RANGE,
1142 ) -> HRESULT,
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,
1149 ) -> HRESULT,
1150 fn GetFontFamilyNameLength(
1151 currentPosition: UINT32,
1152 nameLength: *mut UINT32,
1153 textRange: *mut DWRITE_TEXT_RANGE,
1154 ) -> HRESULT,
1155 fn GetFontFamilyName(
1156 currentPosition: UINT32,
1157 fontFamilyName: *mut WCHAR,
1158 nameSize: UINT32,
1159 textRange: *mut DWRITE_TEXT_RANGE,
1160 ) -> HRESULT,
1161 fn GetFontWeight(
1162 currentPosition: UINT32,
1163 fontWeight: *mut DWRITE_FONT_WEIGHT,
1164 textRange: *mut DWRITE_TEXT_RANGE,
1165 ) -> HRESULT,
1166 fn GetFontStyle(
1167 currentPosition: UINT32,
1168 fontStyle: *mut DWRITE_FONT_STYLE,
1169 textRange: *mut DWRITE_TEXT_RANGE,
1170 ) -> HRESULT,
1171 fn GetFontStretch(
1172 currentPosition: UINT32,
1173 fontStretch: *mut DWRITE_FONT_STRETCH,
1174 textRange: *mut DWRITE_TEXT_RANGE,
1175 ) -> HRESULT,
1176 fn GetFontSize(
1177 currentPosition: UINT32,
1178 fontSize: *mut FLOAT,
1179 textRange: *mut DWRITE_TEXT_RANGE,
1180 ) -> HRESULT,
1181 fn GetUnderline(
1182 currentPosition: UINT32,
1183 hasUnderline: *mut BOOL,
1184 textRange: *mut DWRITE_TEXT_RANGE,
1185 ) -> HRESULT,
1186 fn GetStrikethrough(
1187 currentPosition: UINT32,
1188 hasStrikethrough: *mut BOOL,
1189 textRange: *mut DWRITE_TEXT_RANGE,
1190 ) -> HRESULT,
1191 fn GetDrawingEffect(
1192 currentPosition: UINT32,
1193 drawingEffect: *mut *mut IUnknown,
1194 textRange: *mut DWRITE_TEXT_RANGE,
1195 ) -> HRESULT,
1196 fn GetInlineObject(
1197 currentPosition: UINT32,
1198 inlineObject: *mut *mut IDWriteInlineObject,
1199 textRange: *mut DWRITE_TEXT_RANGE,
1200 ) -> HRESULT,
1201 fn GetTypography(
1202 currentPosition: UINT32,
1203 typography: *mut *mut IDWriteTypography,
1204 textRange: *mut DWRITE_TEXT_RANGE,
1205 ) -> HRESULT,
1206 fn GetLocaleNameLength(
1207 currentPosition: UINT32,
1208 nameLength: *mut UINT32,
1209 textRange: *mut DWRITE_TEXT_RANGE,
1210 ) -> HRESULT,
1211 fn GetLocaleName(
1212 currentPosition: UINT32,
1213 localeName: *mut WCHAR,
1214 nameSize: UINT32,
1215 textRange: *mut DWRITE_TEXT_RANGE,
1216 ) -> HRESULT,
1217 fn Draw(
1218 clientDrawingContext: *mut c_void,
1219 renderer: *mut IDWriteTextRenderer,
1220 originX: FLOAT,
1221 originY: FLOAT,
1222 ) -> HRESULT,
1223 fn GetLineMetrics(
1224 lineMetrics: *mut DWRITE_LINE_METRICS,
1225 maxLineCount: UINT32,
1226 actualLineCount: *mut UINT32,
1227 ) -> HRESULT,
1228 fn GetMetrics(
1229 textMetrics: *mut DWRITE_TEXT_METRICS,
1230 ) -> HRESULT,
1231 fn GetOverhangMetrics(
1232 overhangs: *mut DWRITE_OVERHANG_METRICS,
1233 ) -> HRESULT,
1234 fn GetClusterMetrics(
1235 clusterMetrics: *mut DWRITE_CLUSTER_METRICS,
1236 maxClusterCount: UINT32,
1237 actualClusterCount: *mut UINT32,
1238 ) -> HRESULT,
1239 fn DetermineMinWidth(
1240 minWidth: *mut FLOAT,
1241 ) -> HRESULT,
1242 fn HitTestPoint(
1243 pointX: FLOAT,
1244 pointY: FLOAT,
1245 isTrailingHit: *mut BOOL,
1246 isInside: *mut BOOL,
1247 hitTestMetrics: *mut DWRITE_HIT_TEST_METRICS,
1248 ) -> HRESULT,
1249 fn HitTestTextPosition(
1250 textPosition: UINT32,
1251 isTrailingHit: BOOL,
1252 pointX: *mut FLOAT,
1253 pointY: *mut FLOAT,
1254 hitTestMetrics: *mut DWRITE_HIT_TEST_METRICS,
1255 ) -> HRESULT,
1256 fn HitTestTextRange(
1257 textPosition: UINT32,
1258 textLength: UINT32,
1259 originX: FLOAT,
1260 originY: FLOAT,
1261 hitTestMetrics: *mut DWRITE_HIT_TEST_METRICS,
1262 maxHitTestMetricsCount: UINT32,
1263 actualHitTestMetricsCount: *mut UINT32,
1264 ) -> HRESULT,
1265 }}
1266 RIDL!{#[uuid(0x5e5a32a3, 0x8dff, 0x4773, 0x9f, 0xf6, 0x06, 0x96, 0xea, 0xb7, 0x72, 0x67)]
1267 interface IDWriteBitmapRenderTarget(IDWriteBitmapRenderTargetVtbl): IUnknown(IUnknownVtbl) {
1268 fn DrawGlyphRun(
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,
1276 ) -> HRESULT,
1277 fn GetMemoryDC() -> HDC,
1278 fn GetPixelsPerDip() -> FLOAT,
1279 fn SetPixelsPerDip(
1280 pixelsPerDip: FLOAT,
1281 ) -> HRESULT,
1282 fn GetCurrentTransform(
1283 transform: *mut DWRITE_MATRIX,
1284 ) -> HRESULT,
1285 fn SetCurrentTransform(
1286 transform: *const DWRITE_MATRIX,
1287 ) -> HRESULT,
1288 fn GetSize(
1289 size: *mut SIZE,
1290 ) -> HRESULT,
1291 fn Resize(
1292 width: UINT32,
1293 height: UINT32,
1294 ) -> HRESULT,
1295 }}
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,
1301 ) -> HRESULT,
1302 fn ConvertFontToLOGFONT(
1303 font: *mut IDWriteFont,
1304 logFont: *mut LOGFONTW,
1305 isSystemFont: *mut BOOL,
1306 ) -> HRESULT,
1307 fn ConvertFontFaceToLOGFONT(
1308 font: *mut IDWriteFontFace,
1309 logFont: *mut LOGFONTW,
1310 ) -> HRESULT,
1311 fn CreateFontFaceFromHdc(
1312 hdc: HDC,
1313 fontFace: *mut *mut IDWriteFontFace,
1314 ) -> HRESULT,
1315 fn CreateBitmapRenderTarget(
1316 hdc: HDC,
1317 width: UINT32,
1318 height: UINT32,
1319 renderTarget: *mut *mut IDWriteBitmapRenderTarget,
1320 ) -> HRESULT,
1321 }}
1322 ENUM!{enum DWRITE_TEXTURE_TYPE {
1323 DWRITE_TEXTURE_ALIASED_1x1 = 0,
1324 DWRITE_TEXTURE_CLEARTYPE_3x1 = 1,
1325 }}
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,
1332 ) -> HRESULT,
1333 fn CreateAlphaTexture(
1334 textureType: DWRITE_TEXTURE_TYPE,
1335 textureBounds: *const RECT,
1336 alphaValues: *mut BYTE,
1337 bufferSize: UINT32,
1338 ) -> HRESULT,
1339 fn GetAlphaBlendParams(
1340 renderingParams: *mut IDWriteRenderingParams,
1341 blendGamma: *mut FLOAT,
1342 blendEnhancedContrast: *mut FLOAT,
1343 blendClearTypeLevel: *mut FLOAT,
1344 ) -> HRESULT,
1345 }}
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,
1351 ) -> HRESULT,
1352 fn CreateCustomFontCollection(
1353 collectionLoader: *mut IDWriteFontCollectionLoader,
1354 collectionKey: *const c_void,
1355 collectionKeySize: UINT32,
1356 fontCollection: *mut *mut IDWriteFontCollection,
1357 ) -> HRESULT,
1358 fn RegisterFontCollectionLoader(
1359 fontCollectionLoader: *mut IDWriteFontCollectionLoader,
1360 ) -> HRESULT,
1361 fn UnregisterFontCollectionLoader(
1362 fontCollectionLoader: *mut IDWriteFontCollectionLoader,
1363 ) -> HRESULT,
1364 fn CreateFontFileReference(
1365 filePath: *const WCHAR,
1366 lastWriteTime: *const FILETIME,
1367 fontFile: *mut *mut IDWriteFontFile,
1368 ) -> HRESULT,
1369 fn CreateCustomFontFileReference(
1370 fontFileReferenceKey: *const c_void,
1371 fontFileReferenceKeySize: UINT32,
1372 fontFileLoader: *mut IDWriteFontFileLoader,
1373 fontFile: *mut *mut IDWriteFontFile,
1374 ) -> HRESULT,
1375 fn CreateFontFace(
1376 fontFaceType: DWRITE_FONT_FACE_TYPE,
1377 numberOfFiles: UINT32,
1378 fontFiles: *const *mut IDWriteFontFile,
1379 faceIndex: UINT32,
1380 fontFaceSimulationFlags: DWRITE_FONT_SIMULATIONS,
1381 fontFace: *mut *mut IDWriteFontFace,
1382 ) -> HRESULT,
1383 fn CreateRenderingParams(
1384 renderingParams: *mut *mut IDWriteRenderingParams,
1385 ) -> HRESULT,
1386 fn CreateMonitorRenderingParams(
1387 monitor: HMONITOR,
1388 renderingParams: *mut *mut IDWriteRenderingParams,
1389 ) -> HRESULT,
1390 fn CreateCustomRenderingParams(
1391 gamma: FLOAT,
1392 enhancedContrast: FLOAT,
1393 clearTypeLevel: FLOAT,
1394 pixelGeometry: DWRITE_PIXEL_GEOMETRY,
1395 renderingMode: DWRITE_RENDERING_MODE,
1396 renderingParams: *mut *mut IDWriteRenderingParams,
1397 ) -> HRESULT,
1398 fn RegisterFontFileLoader(
1399 fontFileLoader: *mut IDWriteFontFileLoader,
1400 ) -> HRESULT,
1401 fn UnregisterFontFileLoader(
1402 fontFileLoader: *mut IDWriteFontFileLoader,
1403 ) -> HRESULT,
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,
1410 fontSize: FLOAT,
1411 localeName: *const WCHAR,
1412 textFormat: *mut *mut IDWriteTextFormat,
1413 ) -> HRESULT,
1414 fn CreateTypography(
1415 typography: *mut *mut IDWriteTypography,
1416 ) -> HRESULT,
1417 fn GetGdiInterop(
1418 gdiInterop: *mut *mut IDWriteGdiInterop,
1419 ) -> HRESULT,
1420 fn CreateTextLayout(
1421 string: *const WCHAR,
1422 stringLength: UINT32,
1423 textFormat: *mut IDWriteTextFormat,
1424 maxWidth: FLOAT,
1425 maxHeight: FLOAT,
1426 textLayout: *mut *mut IDWriteTextLayout,
1427 ) -> HRESULT,
1428 fn CreateGdiCompatibleTextLayout(
1429 string: *const WCHAR,
1430 stringLength: UINT32,
1431 textFormat: *mut IDWriteTextFormat,
1432 layoutWidth: FLOAT,
1433 layoutHeight: FLOAT,
1434 pixelsPerDip: FLOAT,
1435 transform: *const DWRITE_MATRIX,
1436 useGdiNatrual: BOOL,
1437 textLayout: *mut *mut IDWriteTextLayout,
1438 ) -> HRESULT,
1439 fn CreateEllipsisTrimmingSign(
1440 textFormat: *mut IDWriteTextFormat,
1441 trimmingSign: *mut *mut IDWriteInlineObject,
1442 ) -> HRESULT,
1443 fn CreateTextAnalyzer(
1444 textAnalyzer: *mut *mut IDWriteTextAnalyzer,
1445 ) -> HRESULT,
1446 fn CreateNumberSubstitution(
1447 substitutionMethod: DWRITE_NUMBER_SUBSTITUTION_METHOD,
1448 localeName: *const WCHAR,
1449 ignoreUserOverride: BOOL,
1450 numberSubstitution: *mut *mut IDWriteNumberSubstitution,
1451 ) -> HRESULT,
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,
1461 ) -> HRESULT,
1462 }}
1463 pub const FACILITY_DWRITE: HRESULT = 0x898;
1464 pub const DWRITE_ERR_BASE: HRESULT = 0x5000;
1465 #[inline]
MAKE_DWRITE_HR(severity: HRESULT, code: HRESULT) -> HRESULT1466 pub fn MAKE_DWRITE_HR(severity: HRESULT, code: HRESULT) -> HRESULT {
1467 MAKE_HRESULT!(severity, FACILITY_DWRITE, DWRITE_ERR_BASE + code)
1468 }
1469 #[inline]
MAKE_DWRITE_HR_ERR(code: HRESULT) -> HRESULT1470 pub fn MAKE_DWRITE_HR_ERR(code: HRESULT) -> HRESULT {
1471 MAKE_DWRITE_HR(SEVERITY_ERROR, code)
1472 }
1473 extern "system" {
DWriteCreateFactory( factoryType: DWRITE_FACTORY_TYPE, iid: REFIID, factory: *mut *mut IUnknown, ) -> HRESULT1474 pub fn DWriteCreateFactory(
1475 factoryType: DWRITE_FACTORY_TYPE, iid: REFIID, factory: *mut *mut IUnknown,
1476 ) -> HRESULT;
1477 }
1478