dwrite: Implement GetGlyphIndices from the CMAP table.
[wine/multimedia.git] / include / dwrite.idl
blob04c523c1f7668aad5fb979d9733f4be5d7164e73
1 /*
2 * Copyright 2012 Nikolay Sivov for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 import "unknwn.idl";
20 import "dcommon.h";
22 interface IDWriteFactory;
23 interface IDWriteFontCollection;
24 interface IDWriteFontFamily;
25 interface IDWriteFontFace;
26 interface IDWriteInlineObject;
28 interface ID2D1SimplifiedGeometrySink;
29 typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink;
31 cpp_quote("#ifndef _WINDEF_")
32 /* already defined in windef.h but needed for WIDL */
33 typedef void *HMONITOR;
34 cpp_quote("#endif /* _WINDEF_ */")
36 cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
37 cpp_quote("#undef GetGlyphIndices")
38 cpp_quote("#endif")
40 typedef enum DWRITE_FACTORY_TYPE
42 DWRITE_FACTORY_TYPE_SHARED,
43 DWRITE_FACTORY_TYPE_ISOLATED
44 } DWRITE_FACTORY_TYPE;
46 typedef enum DWRITE_FONT_FILE_TYPE
48 DWRITE_FONT_FILE_TYPE_UNKNOWN,
49 DWRITE_FONT_FILE_TYPE_CFF,
50 DWRITE_FONT_FILE_TYPE_TRUETYPE,
51 DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION,
52 DWRITE_FONT_FILE_TYPE_TYPE1_PFM,
53 DWRITE_FONT_FILE_TYPE_TYPE1_PFB,
54 DWRITE_FONT_FILE_TYPE_VECTOR,
55 DWRITE_FONT_FILE_TYPE_BITMAP
56 } DWRITE_FONT_FILE_TYPE;
58 typedef enum DWRITE_FONT_FACE_TYPE
60 DWRITE_FONT_FACE_TYPE_CFF,
61 DWRITE_FONT_FACE_TYPE_TRUETYPE,
62 DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION,
63 DWRITE_FONT_FACE_TYPE_TYPE1,
64 DWRITE_FONT_FACE_TYPE_VECTOR,
65 DWRITE_FONT_FACE_TYPE_BITMAP,
66 DWRITE_FONT_FACE_TYPE_UNKNOWN
67 } DWRITE_FONT_FACE_TYPE;
69 typedef enum DWRITE_FONT_WEIGHT
71 DWRITE_FONT_WEIGHT_THIN = 100,
72 DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200,
73 DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200,
74 DWRITE_FONT_WEIGHT_LIGHT = 300,
75 DWRITE_FONT_WEIGHT_NORMAL = 400,
76 DWRITE_FONT_WEIGHT_REGULAR = 400,
77 DWRITE_FONT_WEIGHT_MEDIUM = 500,
78 DWRITE_FONT_WEIGHT_DEMI_BOLD = 600,
79 DWRITE_FONT_WEIGHT_SEMI_BOLD = 600,
80 DWRITE_FONT_WEIGHT_BOLD = 700,
81 DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800,
82 DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800,
83 DWRITE_FONT_WEIGHT_BLACK = 900,
84 DWRITE_FONT_WEIGHT_HEAVY = 900,
85 DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950,
86 DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950
87 } DWRITE_FONT_WEIGHT;
89 typedef enum DWRITE_FONT_STRETCH
91 DWRITE_FONT_STRETCH_UNDEFINED = 0,
92 DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1,
93 DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2,
94 DWRITE_FONT_STRETCH_CONDENSED = 3,
95 DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4,
96 DWRITE_FONT_STRETCH_NORMAL = 5,
97 DWRITE_FONT_STRETCH_MEDIUM = 5,
98 DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6,
99 DWRITE_FONT_STRETCH_EXPANDED = 7,
100 DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8,
101 DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
102 } DWRITE_FONT_STRETCH;
104 typedef enum DWRITE_FONT_STYLE
106 DWRITE_FONT_STYLE_NORMAL,
107 DWRITE_FONT_STYLE_OBLIQUE,
108 DWRITE_FONT_STYLE_ITALIC
109 } DWRITE_FONT_STYLE;
111 typedef enum DWRITE_INFORMATIONAL_STRING_ID
113 DWRITE_INFORMATIONAL_STRING_NONE,
114 DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE,
115 DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS,
116 DWRITE_INFORMATIONAL_STRING_TRADEMARK,
117 DWRITE_INFORMATIONAL_STRING_MANUFACTURER,
118 DWRITE_INFORMATIONAL_STRING_DESIGNER,
119 DWRITE_INFORMATIONAL_STRING_DESIGNER_URL,
120 DWRITE_INFORMATIONAL_STRING_DESCRIPTION,
121 DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL,
122 DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION,
123 DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL,
124 DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES,
125 DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES,
126 DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES,
127 DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES,
128 DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT
129 } DWRITE_INFORMATIONAL_STRING_ID;
131 typedef enum DWRITE_FONT_SIMULATIONS
133 DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
134 DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
135 DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002
136 } DWRITE_FONT_SIMULATIONS;
138 typedef enum DWRITE_PIXEL_GEOMETRY
140 DWRITE_PIXEL_GEOMETRY_FLAT,
141 DWRITE_PIXEL_GEOMETRY_RGB,
142 DWRITE_PIXEL_GEOMETRY_BGR
143 } DWRITE_PIXEL_GEOMETRY;
145 typedef enum DWRITE_RENDERING_MODE
147 DWRITE_RENDERING_MODE_DEFAULT,
148 DWRITE_RENDERING_MODE_ALIASED,
149 DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
150 DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL,
151 DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL,
152 DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
153 DWRITE_RENDERING_MODE_OUTLINE
154 } DWRITE_RENDERING_MODE;
156 typedef enum DWRITE_TEXT_ALIGNMENT
158 DWRITE_TEXT_ALIGNMENT_LEADING,
159 DWRITE_TEXT_ALIGNMENT_TRAILING,
160 DWRITE_TEXT_ALIGNMENT_CENTER,
161 DWRITE_TEXT_ALIGNMENT_JUSTIFIED
162 } DWRITE_TEXT_ALIGNMENT;
164 typedef enum DWRITE_PARAGRAPH_ALIGNMENT
166 DWRITE_PARAGRAPH_ALIGNMENT_NEAR,
167 DWRITE_PARAGRAPH_ALIGNMENT_FAR,
168 DWRITE_PARAGRAPH_ALIGNMENT_CENTER
169 } DWRITE_PARAGRAPH_ALIGNMENT;
171 typedef enum DWRITE_WORD_WRAPPING
173 DWRITE_WORD_WRAPPING_WRAP,
174 DWRITE_WORD_WRAPPING_NO_WRAP
175 } DWRITE_WORD_WRAPPING;
177 typedef enum DWRITE_READING_DIRECTION
179 DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
180 DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
181 } DWRITE_READING_DIRECTION;
183 typedef enum DWRITE_FLOW_DIRECTION
185 DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
186 } DWRITE_FLOW_DIRECTION;
188 typedef enum DWRITE_TRIMMING_GRANULARITY
190 DWRITE_TRIMMING_GRANULARITY_NONE,
191 DWRITE_TRIMMING_GRANULARITY_CHARACTER,
192 DWRITE_TRIMMING_GRANULARITY_WORD
193 } DWRITE_TRIMMING_GRANULARITY;
195 typedef enum DWRITE_BREAK_CONDITION
197 DWRITE_BREAK_CONDITION_NEUTRAL,
198 DWRITE_BREAK_CONDITION_CAN_BREAK,
199 DWRITE_BREAK_CONDITION_MAY_NOT_BREAK,
200 DWRITE_BREAK_CONDITION_MUST_BREAK
201 } DWRITE_BREAK_CONDITION;
203 typedef enum DWRITE_LINE_SPACING_METHOD
205 DWRITE_LINE_SPACING_METHOD_DEFAULT,
206 DWRITE_LINE_SPACING_METHOD_UNIFORM
207 } DWRITE_LINE_SPACING_METHOD;
209 typedef enum DWRITE_FONT_FEATURE_TAG
211 DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, /* 'afrc' */
212 DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, /* 'c2pc' */
213 DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, /* 'c2sc' */
214 DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, /* 'calt' */
215 DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, /* 'case' */
216 DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, /* 'ccmp' */
217 DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, /* 'clig' */
218 DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, /* 'cpsp' */
219 DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, /* 'cswh' */
220 DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, /* 'curs' */
221 DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, /* 'dflt' */
222 DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, /* 'dlig' */
223 DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, /* 'expt' */
224 DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, /* 'frac' */
225 DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, /* 'fwid' */
226 DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, /* 'half' */
227 DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, /* 'haln' */
228 DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, /* 'halt' */
229 DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, /* 'hist' */
230 DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, /* 'hkna' */
231 DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, /* 'hlig' */
232 DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, /* 'hwid' */
233 DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, /* 'hojo' */
234 DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, /* 'jp04' */
235 DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, /* 'jp78' */
236 DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, /* 'jp83' */
237 DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, /* 'jp90' */
238 DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, /* 'kern' */
239 DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, /* 'liga' */
240 DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, /* 'lnum' */
241 DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, /* 'locl' */
242 DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, /* 'mark' */
243 DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, /* 'mgrk' */
244 DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, /* 'mkmk' */
245 DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, /* 'nalt' */
246 DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, /* 'nlck' */
247 DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, /* 'onum' */
248 DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, /* 'ordn' */
249 DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, /* 'palt' */
250 DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, /* 'pcap' */
251 DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, /* 'pnum' */
252 DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, /* 'pwid' */
253 DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, /* 'qwid' */
254 DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, /* 'rlig' */
255 DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, /* 'ruby' */
256 DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, /* 'salt' */
257 DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, /* 'sinf' */
258 DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, /* 'smcp' */
259 DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, /* 'smpl' */
260 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, /* 'ss01' */
261 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, /* 'ss02' */
262 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, /* 'ss03' */
263 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, /* 'ss04' */
264 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, /* 'ss05' */
265 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, /* 'ss06' */
266 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, /* 'ss07' */
267 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, /* 'ss08' */
268 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, /* 'ss09' */
269 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, /* 'ss10' */
270 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, /* 'ss11' */
271 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, /* 'ss12' */
272 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, /* 'ss13' */
273 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, /* 'ss14' */
274 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, /* 'ss15' */
275 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, /* 'ss16' */
276 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, /* 'ss17' */
277 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, /* 'ss18' */
278 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, /* 'ss19' */
279 DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, /* 'ss20' */
280 DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, /* 'subs' */
281 DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, /* 'sups' */
282 DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, /* 'swsh' */
283 DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, /* 'titl' */
284 DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, /* 'tnam' */
285 DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, /* 'tnum' */
286 DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, /* 'trad' */
287 DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, /* 'twid' */
288 DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, /* 'unic' */
289 DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, /* 'zero' */
290 } DWRITE_FONT_FEATURE_TAG;
292 typedef enum DWRITE_SCRIPT_SHAPES
294 DWRITE_SCRIPT_SHAPES_DEFAULT = 0,
295 DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1
296 } DWRITE_SCRIPT_SHAPES;
298 typedef enum DWRITE_NUMBER_SUBSTITUTION_METHOD
300 DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE,
301 DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL,
302 DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE,
303 DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL,
304 DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL
305 } DWRITE_NUMBER_SUBSTITUTION_METHOD;
307 typedef enum DWRITE_TEXTURE_TYPE
309 DWRITE_TEXTURE_ALIASED_1x1,
310 DWRITE_TEXTURE_CLEARTYPE_3x1
311 } DWRITE_TEXTURE_TYPE;
313 typedef struct DWRITE_FONT_METRICS
315 UINT16 designUnitsPerEm;
316 UINT16 ascent;
317 UINT16 descent;
318 INT16 lineGap;
319 UINT16 capHeight;
320 UINT16 xHeight;
321 INT16 underlinePosition;
322 UINT16 underlineThickness;
323 INT16 strikethroughPosition;
324 UINT16 strikethroughThickness;
325 } DWRITE_FONT_METRICS;
327 typedef struct DWRITE_GLYPH_METRICS
329 INT32 leftSideBearing;
330 UINT32 advanceWidth;
331 INT32 rightSideBearing;
332 INT32 topSideBearing;
333 UINT32 advanceHeight;
334 INT32 bottomSideBearing;
335 INT32 verticalOriginY;
336 } DWRITE_GLYPH_METRICS;
338 typedef struct DWRITE_GLYPH_OFFSET
340 FLOAT advanceOffset;
341 FLOAT ascenderOffset;
342 } DWRITE_GLYPH_OFFSET;
344 typedef struct DWRITE_MATRIX
346 FLOAT m11;
347 FLOAT m12;
348 FLOAT m21;
349 FLOAT m22;
350 FLOAT dx;
351 FLOAT dy;
352 } DWRITE_MATRIX;
354 typedef struct DWRITE_TRIMMING
356 DWRITE_TRIMMING_GRANULARITY granularity;
357 UINT32 delimiter;
358 UINT32 delimiterCount;
359 } DWRITE_TRIMMING;
361 typedef struct DWRITE_GLYPH_RUN
363 IDWriteFontFace* fontFace;
364 FLOAT fontEmSize;
365 UINT32 glyphCount;
366 UINT16 const* glyphIndices;
367 FLOAT const* glyphAdvances;
368 DWRITE_GLYPH_OFFSET const* glyphOffsets;
369 BOOL isSideways;
370 UINT32 bidiLevel;
371 } DWRITE_GLYPH_RUN;
373 typedef struct DWRITE_GLYPH_RUN_DESCRIPTION
375 WCHAR const* localeName;
376 WCHAR const* string;
377 UINT32 stringLength;
378 UINT16 const* clusterMap;
379 UINT32 textPosition;
380 } DWRITE_GLYPH_RUN_DESCRIPTION;
382 typedef struct DWRITE_UNDERLINE
384 FLOAT width;
385 FLOAT thickness;
386 FLOAT offset;
387 FLOAT runHeight;
388 DWRITE_READING_DIRECTION readingDirection;
389 DWRITE_FLOW_DIRECTION flowDirection;
390 WCHAR const* localeName;
391 DWRITE_MEASURING_MODE measuringMode;
392 } DWRITE_UNDERLINE;
394 typedef struct DWRITE_STRIKETHROUGH
396 FLOAT width;
397 FLOAT thickness;
398 FLOAT offset;
399 DWRITE_READING_DIRECTION readingDirection;
400 DWRITE_FLOW_DIRECTION flowDirection;
401 WCHAR const* localeName;
402 DWRITE_MEASURING_MODE measuringMode;
403 } DWRITE_STRIKETHROUGH;
405 typedef struct DWRITE_INLINE_OBJECT_METRICS
407 FLOAT width;
408 FLOAT height;
409 FLOAT baseline;
410 BOOL supportsSideways;
411 } DWRITE_INLINE_OBJECT_METRICS;
413 typedef struct DWRITE_OVERHANG_METRICS
415 FLOAT left;
416 FLOAT top;
417 FLOAT right;
418 FLOAT bottom;
419 } DWRITE_OVERHANG_METRICS;
421 typedef struct DWRITE_FONT_FEATURE
423 DWRITE_FONT_FEATURE_TAG nameTag;
424 UINT32 parameter;
425 } DWRITE_FONT_FEATURE;
427 typedef struct DWRITE_TEXT_RANGE
429 UINT32 startPosition;
430 UINT32 length;
431 } DWRITE_TEXT_RANGE;
433 typedef struct DWRITE_LINE_METRICS
435 UINT32 length;
436 UINT32 trailingWhitespaceLength;
437 UINT32 newlineLength;
438 FLOAT height;
439 FLOAT baseline;
440 BOOL isTrimmed;
441 } DWRITE_LINE_METRICS;
443 typedef struct DWRITE_TEXT_METRICS
445 FLOAT left;
446 FLOAT top;
447 FLOAT width;
448 FLOAT widthIncludingTrailingWhitespace;
449 FLOAT height;
450 FLOAT layoutWidth;
451 FLOAT layoutHeight;
452 UINT32 maxBidiReorderingDepth;
453 UINT32 lineCount;
454 } DWRITE_TEXT_METRICS;
456 typedef struct DWRITE_CLUSTER_METRICS
458 FLOAT width;
459 UINT16 length;
460 UINT16 canWrapLineAfter : 1;
461 UINT16 isWhitespace : 1;
462 UINT16 isNewline : 1;
463 UINT16 isSoftHyphen : 1;
464 UINT16 isRightToLeft : 1;
465 UINT16 padding : 11;
466 } DWRITE_CLUSTER_METRICS;
468 typedef struct DWRITE_HIT_TEST_METRICS
470 UINT32 textPosition;
471 UINT32 length;
472 FLOAT left;
473 FLOAT top;
474 FLOAT width;
475 FLOAT height;
476 UINT32 bidiLevel;
477 BOOL isText;
478 BOOL isTrimmed;
479 } DWRITE_HIT_TEST_METRICS;
481 typedef struct DWRITE_SCRIPT_ANALYSIS
483 UINT16 script;
484 DWRITE_SCRIPT_SHAPES shapes;
485 } DWRITE_SCRIPT_ANALYSIS;
487 typedef struct DWRITE_LINE_BREAKPOINT
489 UINT8 breakConditionBefore : 2;
490 UINT8 breakConditionAfter : 2;
491 UINT8 isWhitespace : 1;
492 UINT8 isSoftHyphen : 1;
493 UINT8 padding : 2;
494 } DWRITE_LINE_BREAKPOINT;
496 typedef struct DWRITE_TYPOGRAPHIC_FEATURES
498 DWRITE_FONT_FEATURE* features;
499 UINT32 featureCount;
500 } DWRITE_TYPOGRAPHIC_FEATURES;
502 typedef struct DWRITE_SHAPING_TEXT_PROPERTIES
504 UINT16 isShapedAlone : 1;
505 UINT16 reserved : 15;
506 } DWRITE_SHAPING_TEXT_PROPERTIES;
508 typedef struct DWRITE_SHAPING_GLYPH_PROPERTIES
510 UINT16 justification : 4;
511 UINT16 isClusterStart : 1;
512 UINT16 isDiacritic : 1;
513 UINT16 isZeroWidthSpace : 1;
514 UINT16 reserved : 9;
515 } DWRITE_SHAPING_GLYPH_PROPERTIES;
518 local,
519 object,
520 uuid(6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0)
522 interface IDWriteFontFileStream : IUnknown
524 HRESULT ReadFileFragment(
525 void const **fragment_start,
526 UINT64 offset,
527 UINT64 fragment_size,
528 void **fragment_context);
530 void ReleaseFileFragment(void *fragment_context);
531 HRESULT GetFileSize(UINT64 *size);
532 HRESULT GetLastWriteTime(UINT64 *last_writetime);
536 local,
537 object,
538 uuid(727cad4e-d6af-4c9e-8a08-d695b11caa49)
540 interface IDWriteFontFileLoader : IUnknown
542 HRESULT CreateStreamFromKey(
543 void const *key,
544 UINT32 key_size,
545 IDWriteFontFileStream **stream);
549 local,
550 object,
551 uuid(b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2)
553 interface IDWriteLocalFontFileLoader : IDWriteFontFileLoader
555 HRESULT GetFilePathLengthFromKey(void const *key, UINT32 key_size, UINT32 *length);
556 HRESULT GetFilePathFromKey(void const *key, UINT32 key_size, WCHAR *path, UINT32 length);
557 HRESULT GetLastWriteTimeFromKey(void const *key, UINT32 key_size, FILETIME *writetime);
561 local,
562 object,
563 uuid(739d886a-cef5-47dc-8769-1a8b41bebbb0)
565 interface IDWriteFontFile : IUnknown
567 HRESULT GetReferenceKey(
568 void const **key,
569 UINT32 *key_size);
571 HRESULT GetLoader(IDWriteFontFileLoader **loader);
573 HRESULT Analyze(
574 BOOL *is_supported_fonttype,
575 DWRITE_FONT_FILE_TYPE *file_type,
576 DWRITE_FONT_FACE_TYPE *face_type,
577 UINT32 *faces_num);
581 local,
582 object,
583 uuid(72755049-5ff7-435d-8348-4be97cfa6c7c)
585 interface IDWriteFontFileEnumerator : IUnknown
587 HRESULT MoveNext(BOOL *has_current_file);
588 HRESULT GetCurrentFontFile(IDWriteFontFile **font_file);
592 local,
593 object,
594 uuid(cca920e4-52f0-492b-bfa8-29c72ee0a468)
596 interface IDWriteFontCollectionLoader : IUnknown
598 HRESULT CreateEnumeratorFromKey(
599 IDWriteFactory* factory,
600 void const* key,
601 UINT32 key_size,
602 IDWriteFontFileEnumerator **enumerator);
606 local,
607 object,
608 uuid(08256209-099a-4b34-b86d-c22b110e7771)
610 interface IDWriteLocalizedStrings : IUnknown
612 UINT32 GetCount();
614 HRESULT FindLocaleName(
615 WCHAR const *locale_name,
616 UINT32 *index,
617 BOOL *exists);
619 HRESULT GetLocaleNameLength(UINT32 index, UINT32 *length);
620 HRESULT GetLocaleName(UINT32 index, WCHAR *locale_name, UINT32 size);
621 HRESULT GetStringLength(UINT32 index, UINT32 *length);
622 HRESULT GetString(UINT32 index, WCHAR *buffer, UINT32 size);
626 local,
627 object,
628 uuid(2f0da53a-2add-47cd-82ee-d9ec34688e75)
630 interface IDWriteRenderingParams : IUnknown
632 FLOAT GetGamma();
633 FLOAT GetEnhancedContrast();
634 FLOAT GetClearTypeLevel();
635 DWRITE_PIXEL_GEOMETRY GetPixelGeometry();
636 DWRITE_RENDERING_MODE GetRenderingMode();
640 local,
641 object,
642 uuid(5f49804d-7024-4d43-bfa9-d25984f53849)
644 interface IDWriteFontFace : IUnknown
646 DWRITE_FONT_FACE_TYPE GetType();
647 HRESULT GetFiles(UINT32 *number_of_files, IDWriteFontFile **fontfiles);
648 UINT32 GetIndex();
649 DWRITE_FONT_SIMULATIONS GetSimulations();
650 BOOL IsSymbolFont();
651 void GetMetrics(DWRITE_FONT_METRICS *metrics);
652 UINT16 GetGlyphCount();
654 HRESULT GetDesignGlyphMetrics(
655 UINT16 const *glyph_indices,
656 UINT32 glyph_count,
657 DWRITE_GLYPH_METRICS *metrics,
658 [defaultvalue(FALSE)] BOOL is_sideways);
660 HRESULT GetGlyphIndices(
661 UINT32 const *codepoints,
662 UINT32 count,
663 UINT16 *glyph_indices);
665 HRESULT TryGetFontTable(
666 UINT32 table_tag,
667 const void **table_data,
668 UINT32 *table_size,
669 void **context,
670 BOOL *exists);
672 void ReleaseFontTable(void *table_context);
674 HRESULT GetGlyphRunOutline(
675 FLOAT emSize,
676 UINT16 const *glyph_indices,
677 FLOAT const* glyph_advances,
678 DWRITE_GLYPH_OFFSET const *glyph_offsets,
679 UINT32 glyph_count,
680 BOOL is_sideways,
681 BOOL is_rtl,
682 IDWriteGeometrySink *geometrysink);
684 HRESULT GetRecommendedRenderingMode(
685 FLOAT emSize,
686 FLOAT pixels_per_dip,
687 DWRITE_MEASURING_MODE mode,
688 IDWriteRenderingParams* params,
689 DWRITE_RENDERING_MODE* rendering_mode);
691 HRESULT GetGdiCompatibleMetrics(
692 FLOAT emSize,
693 FLOAT pixels_per_dip,
694 DWRITE_MATRIX const *transform,
695 DWRITE_FONT_METRICS *metrics);
697 HRESULT GetGdiCompatibleGlyphMetrics(
698 FLOAT emSize,
699 FLOAT pixels_per_dip,
700 DWRITE_MATRIX const *transform,
701 BOOL use_gdi_natural,
702 UINT16 const *glyph_indices,
703 UINT32 glyph_count,
704 DWRITE_GLYPH_METRICS *metrics,
705 [defaultvalue(FALSE)] BOOL is_sideways);
709 local,
710 object,
711 uuid(acd16696-8c14-4f5d-877e-fe3fc1d32737)
713 interface IDWriteFont : IUnknown
715 HRESULT GetFontFamily(IDWriteFontFamily **family);
716 DWRITE_FONT_WEIGHT GetWeight();
717 DWRITE_FONT_STRETCH GetStretch();
718 DWRITE_FONT_STYLE GetStyle();
719 BOOL IsSymbolFont();
721 HRESULT GetFaceNames(IDWriteLocalizedStrings **names);
722 HRESULT GetInformationalStrings(
723 DWRITE_INFORMATIONAL_STRING_ID stringid,
724 IDWriteLocalizedStrings **strings,
725 BOOL *exists);
727 DWRITE_FONT_SIMULATIONS GetSimulations();
728 void GetMetrics(DWRITE_FONT_METRICS *metrics);
729 HRESULT HasCharacter(UINT32 value, BOOL *exists);
730 HRESULT CreateFontFace(IDWriteFontFace **face);
734 local,
735 object,
736 uuid(1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb)
738 interface IDWriteFontList : IUnknown
740 HRESULT GetFontCollection(IDWriteFontCollection **collection);
741 UINT32 GetFontCount();
742 HRESULT GetFont(UINT32 index, IDWriteFont **font);
746 local,
747 object,
748 uuid(da20d8ef-812a-4c43-9802-62ec4abd7add)
750 interface IDWriteFontFamily : IDWriteFontList
752 HRESULT GetFamilyNames(IDWriteLocalizedStrings **names);
754 HRESULT GetFirstMatchingFont(
755 DWRITE_FONT_WEIGHT weight,
756 DWRITE_FONT_STRETCH stretch,
757 DWRITE_FONT_STYLE style,
758 IDWriteFont **font);
760 HRESULT GetMatchingFonts(
761 DWRITE_FONT_WEIGHT weight,
762 DWRITE_FONT_STRETCH stretch,
763 DWRITE_FONT_STYLE style,
764 IDWriteFontList **fonts);
768 local,
769 object,
770 uuid(a84cee02-3eea-4eee-a827-87c1a02a0fcc)
772 interface IDWriteFontCollection : IUnknown
774 UINT32 GetFontFamilyCount();
775 HRESULT GetFontFamily(UINT32 index, IDWriteFontFamily **family);
776 HRESULT FindFamilyName(WCHAR const *name, UINT32 *index, BOOL *exists);
777 HRESULT GetFontFromFontFace(IDWriteFontFace *face, IDWriteFont **font);
781 local,
782 object,
783 uuid(eaf3a2da-ecf4-4d24-b644-b34f6842024b)
785 interface IDWritePixelSnapping : IUnknown
787 HRESULT IsPixelSnappingDisabled(
788 void *client_drawingcontext,
789 BOOL *disabled);
791 HRESULT GetCurrentTransform(
792 void *client_drawingcontext,
793 DWRITE_MATRIX *transform);
795 HRESULT GetPixelsPerDip(
796 void *client_drawingcontext,
797 FLOAT *pixels_per_dip);
801 local,
802 object,
803 uuid(ef8a8135-5cc6-45fe-8825-c5a0724eb819)
805 interface IDWriteTextRenderer : IDWritePixelSnapping
807 HRESULT DrawGlyphRun(
808 void* client_drawingcontext,
809 FLOAT baselineOriginX,
810 FLOAT baselineOriginY,
811 DWRITE_MEASURING_MODE mode,
812 DWRITE_GLYPH_RUN const *glyph_run,
813 DWRITE_GLYPH_RUN_DESCRIPTION const *run_descr,
814 IUnknown *drawing_effect);
816 HRESULT DrawUnderline(
817 void *client_drawingcontext,
818 FLOAT baselineOriginX,
819 FLOAT baselineOriginY,
820 DWRITE_UNDERLINE const* underline,
821 IUnknown *drawing_effect);
823 HRESULT DrawStrikethrough(
824 void *client_drawingcontext,
825 FLOAT baselineOriginX,
826 FLOAT baselineOriginY,
827 DWRITE_STRIKETHROUGH const* strikethrough,
828 IUnknown *drawing_effect);
830 HRESULT DrawInlineObject(
831 void *client_drawingcontext,
832 FLOAT originX,
833 FLOAT originY,
834 IDWriteInlineObject *object,
835 BOOL is_sideways,
836 BOOL is_rtl,
837 IUnknown *drawing_effect);
841 local,
842 object,
843 uuid(8339fde3-106f-47ab-8373-1c6295eb10b3)
845 interface IDWriteInlineObject : IUnknown
847 HRESULT Draw(
848 void* client_drawingontext,
849 IDWriteTextRenderer* renderer,
850 FLOAT originX,
851 FLOAT originY,
852 BOOL is_sideways,
853 BOOL is_rtl,
854 IUnknown *drawing_effect);
856 HRESULT GetMetrics(DWRITE_INLINE_OBJECT_METRICS *metrics);
857 HRESULT GetOverhangMetrics(DWRITE_OVERHANG_METRICS *overhangs);
858 HRESULT GetBreakConditions(
859 DWRITE_BREAK_CONDITION* condition_before,
860 DWRITE_BREAK_CONDITION* condition_after);
864 local,
865 object,
866 uuid(9c906818-31d7-4fd3-a151-7c5e225db55a)
868 interface IDWriteTextFormat : IUnknown
870 HRESULT SetTextAlignment(DWRITE_TEXT_ALIGNMENT alignment);
871 HRESULT SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT alignment);
872 HRESULT SetWordWrapping(DWRITE_WORD_WRAPPING wrapping);
873 HRESULT SetReadingDirection(DWRITE_READING_DIRECTION direction);
874 HRESULT SetFlowDirection(DWRITE_FLOW_DIRECTION direction);
875 HRESULT SetIncrementalTabStop(FLOAT tabstop);
876 HRESULT SetTrimming(DWRITE_TRIMMING const *trimming, IDWriteInlineObject *trimming_sign);
877 HRESULT SetLineSpacing(DWRITE_LINE_SPACING_METHOD spacing, FLOAT line_spacing, FLOAT baseline);
878 DWRITE_TEXT_ALIGNMENT GetTextAlignment();
879 DWRITE_PARAGRAPH_ALIGNMENT GetParagraphAlignment();
880 DWRITE_WORD_WRAPPING GetWordWrapping();
881 DWRITE_READING_DIRECTION GetReadingDirection();
882 DWRITE_FLOW_DIRECTION GetFlowDirection();
883 FLOAT GetIncrementalTabStop();
884 HRESULT GetTrimming(DWRITE_TRIMMING *options, IDWriteInlineObject **trimming_sign);
886 HRESULT GetLineSpacing(
887 DWRITE_LINE_SPACING_METHOD *method,
888 FLOAT *spacing,
889 FLOAT *baseline);
891 HRESULT GetFontCollection(IDWriteFontCollection **collection);
892 UINT32 GetFontFamilyNameLength();
893 HRESULT GetFontFamilyName(WCHAR *name, UINT32 size);
894 DWRITE_FONT_WEIGHT GetFontWeight();
895 DWRITE_FONT_STYLE GetFontStyle();
896 DWRITE_FONT_STRETCH GetFontStretch();
897 FLOAT GetFontSize();
898 UINT32 GetLocaleNameLength();
899 HRESULT GetLocaleName(WCHAR *name, UINT32 size);
903 local,
904 object,
905 uuid(55f1112b-1dc2-4b3c-9541-f46894ed85b6)
907 interface IDWriteTypography : IUnknown
909 HRESULT AddFontFeature(DWRITE_FONT_FEATURE feature);
910 UINT32 GetFontFeatureCount();
911 HRESULT GetFontFeature(UINT32 index, DWRITE_FONT_FEATURE *feature);
915 local,
916 object,
917 uuid(5e5a32a3-8dff-4773-9ff6-0696eab77267)
919 interface IDWriteBitmapRenderTarget : IUnknown
921 HRESULT DrawGlyphRun(
922 FLOAT baselineOriginX,
923 FLOAT baselineOriginY,
924 DWRITE_MEASURING_MODE measuring_mode,
925 DWRITE_GLYPH_RUN const* glyph_run,
926 IDWriteRenderingParams* params,
927 COLORREF textColor,
928 [defaultvalue(NULL)] RECT *blackbox_rect);
930 HDC GetMemoryDC();
931 FLOAT GetPixelsPerDip();
932 HRESULT SetPixelsPerDip(FLOAT pixels_per_dip);
933 HRESULT GetCurrentTransform(DWRITE_MATRIX *transform);
934 HRESULT SetCurrentTransform(DWRITE_MATRIX const *transform);
935 HRESULT GetSize(SIZE *size);
936 HRESULT Resize(UINT32 width, UINT32 height);
939 cpp_quote("#ifndef _WINGDI_")
940 /* already defined in wingdi.h but needed for WIDL */
941 #define LF_FACESIZE 32
943 typedef struct tagLOGFONTW
945 LONG lfHeight;
946 LONG lfWidth;
947 LONG lfEscapement;
948 LONG lfOrientation;
949 LONG lfWeight;
950 BYTE lfItalic;
951 BYTE lfUnderline;
952 BYTE lfStrikeOut;
953 BYTE lfCharSet;
954 BYTE lfOutPrecision;
955 BYTE lfClipPrecision;
956 BYTE lfQuality;
957 BYTE lfPitchAndFamily;
958 WCHAR lfFaceName[LF_FACESIZE];
959 } LOGFONTW, *PLOGFONTW, *LPLOGFONTW;
960 cpp_quote("#endif /* _WINGDI_ */")
963 local,
964 object,
965 uuid(1edd9491-9853-4299-898f-6432983b6f3a)
967 interface IDWriteGdiInterop : IUnknown
969 HRESULT CreateFontFromLOGFONT(LOGFONTW const *logfont, IDWriteFont **font);
970 HRESULT ConvertFontToLOGFONT(
971 IDWriteFont* font,
972 LOGFONTW* logfont,
973 BOOL *is_systemfont);
975 HRESULT ConvertFontFaceToLOGFONT(IDWriteFontFace* font, LOGFONTW* logfont);
976 HRESULT CreateFontFaceFromHdc(HDC hdc, IDWriteFontFace **fontface);
977 HRESULT CreateBitmapRenderTarget(HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget **target);
981 local,
982 object,
983 uuid(53737037-6d14-410b-9bfe-0b182bb70961)
985 interface IDWriteTextLayout : IDWriteTextFormat
987 HRESULT SetMaxWidth(FLOAT maxWidth);
988 HRESULT SetMaxHeight(FLOAT maxHeight);
989 HRESULT SetFontCollection(IDWriteFontCollection* collection, DWRITE_TEXT_RANGE range);
990 HRESULT SetFontFamilyName(WCHAR const *name, DWRITE_TEXT_RANGE range);
991 HRESULT SetFontWeight(DWRITE_FONT_WEIGHT weight, DWRITE_TEXT_RANGE range);
992 HRESULT SetFontStyle(DWRITE_FONT_STYLE style, DWRITE_TEXT_RANGE range);
993 HRESULT SetFontStretch(DWRITE_FONT_STRETCH stretch, DWRITE_TEXT_RANGE range);
994 HRESULT SetFontSize(FLOAT size, DWRITE_TEXT_RANGE range);
995 HRESULT SetUnderline(BOOL underline, DWRITE_TEXT_RANGE range);
996 HRESULT SetStrikethrough(BOOL strikethrough, DWRITE_TEXT_RANGE range);
997 HRESULT SetDrawingEffect(IUnknown* effect, DWRITE_TEXT_RANGE range);
998 HRESULT SetInlineObject(IDWriteInlineObject *object, DWRITE_TEXT_RANGE range);
999 HRESULT SetTypography(IDWriteTypography* typography, DWRITE_TEXT_RANGE range);
1000 HRESULT SetLocaleName(WCHAR const* locale, DWRITE_TEXT_RANGE range);
1002 FLOAT GetMaxWidth();
1003 FLOAT GetMaxHeight();
1004 HRESULT GetFontCollection(
1005 UINT32 pos,
1006 IDWriteFontCollection** collection,
1007 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1009 HRESULT GetFontFamilyNameLength(
1010 UINT32 pos,
1011 UINT32* len,
1012 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1014 HRESULT GetFontFamilyName(
1015 UINT32 position,
1016 WCHAR* name,
1017 UINT32 name_size,
1018 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1020 HRESULT GetFontWeight(
1021 UINT32 position,
1022 DWRITE_FONT_WEIGHT *weight,
1023 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1025 HRESULT GetFontStyle(
1026 UINT32 currentPosition,
1027 DWRITE_FONT_STYLE *style,
1028 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1030 HRESULT GetFontStretch(
1031 UINT32 position,
1032 DWRITE_FONT_STRETCH *stretch,
1033 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1035 HRESULT GetFontSize(
1036 UINT32 position,
1037 FLOAT *size,
1038 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1040 HRESULT GetUnderline(
1041 UINT32 position,
1042 BOOL *has_underline,
1043 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1045 HRESULT GetStrikethrough(
1046 UINT32 position,
1047 BOOL *has_strikethrough,
1048 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1050 HRESULT GetDrawingEffect(
1051 UINT32 position,
1052 IUnknown **effect,
1053 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1055 HRESULT GetInlineObject(
1056 UINT32 position,
1057 IDWriteInlineObject **object,
1058 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1060 HRESULT GetTypography(
1061 UINT32 position,
1062 IDWriteTypography** typography,
1063 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1065 HRESULT GetLocaleNameLength(
1066 UINT32 position,
1067 UINT32* length,
1068 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1070 HRESULT GetLocaleName(
1071 UINT32 position,
1072 WCHAR* name,
1073 UINT32 name_size,
1074 [defaultvalue(NULL)] DWRITE_TEXT_RANGE *range);
1076 HRESULT Draw(
1077 void *context,
1078 IDWriteTextRenderer* renderer,
1079 FLOAT originX,
1080 FLOAT originY);
1082 HRESULT GetLineMetrics(
1083 DWRITE_LINE_METRICS *metrics,
1084 UINT32 max_count,
1085 UINT32 *actual_count);
1087 HRESULT GetMetrics(DWRITE_TEXT_METRICS *metrics);
1088 HRESULT GetOverhangMetrics(DWRITE_OVERHANG_METRICS *overhangs);
1089 HRESULT GetClusterMetrics(
1090 DWRITE_CLUSTER_METRICS *metrics,
1091 UINT32 max_count,
1092 UINT32* act_count);
1094 HRESULT DetermineMinWidth(FLOAT* min_width);
1095 HRESULT HitTestPoint(
1096 FLOAT pointX,
1097 FLOAT pointY,
1098 BOOL* is_trailinghit,
1099 BOOL* is_inside,
1100 DWRITE_HIT_TEST_METRICS *metrics);
1102 HRESULT HitTestTextPosition(
1103 UINT32 textPosition,
1104 BOOL is_trailinghit,
1105 FLOAT* pointX,
1106 FLOAT* pointY,
1107 DWRITE_HIT_TEST_METRICS *metrics);
1109 HRESULT HitTestTextRange(
1110 UINT32 textPosition,
1111 UINT32 textLength,
1112 FLOAT originX,
1113 FLOAT originY,
1114 DWRITE_HIT_TEST_METRICS *metrics,
1115 UINT32 max_metricscount,
1116 UINT32* actual_metricscount);
1120 local,
1121 object,
1122 uuid(14885cc9-bab0-4f90-b6ed-5c366a2cd03d)
1124 interface IDWriteNumberSubstitution : IUnknown
1129 local,
1130 object,
1131 uuid(688e1a58-5094-47c8-adc8-fbcea60ae92b)
1133 interface IDWriteTextAnalysisSource : IUnknown
1135 HRESULT GetTextAtPosition(
1136 UINT32 position,
1137 WCHAR const** text,
1138 UINT32* text_len);
1140 HRESULT GetTextBeforePosition(
1141 UINT32 position,
1142 WCHAR const** text,
1143 UINT32* text_len);
1145 DWRITE_READING_DIRECTION GetParagraphReadingDirection();
1146 HRESULT GetLocaleName(
1147 UINT32 position,
1148 UINT32* text_len,
1149 WCHAR const** locale);
1151 HRESULT GetNumberSubstitution(
1152 UINT32 position,
1153 UINT32* text_len,
1154 IDWriteNumberSubstitution **substitution);
1158 local,
1159 object,
1160 uuid(5810cd44-0ca0-4701-b3fa-bec5182ae4f6)
1162 interface IDWriteTextAnalysisSink : IUnknown
1164 HRESULT SetScriptAnalysis(
1165 UINT32 position,
1166 UINT32 length,
1167 DWRITE_SCRIPT_ANALYSIS const* scriptanalysis);
1169 HRESULT SetLineBreakpoints(
1170 UINT32 position,
1171 UINT32 length,
1172 DWRITE_LINE_BREAKPOINT const* breakpoints);
1174 HRESULT SetBidiLevel(
1175 UINT32 position,
1176 UINT32 length,
1177 UINT8 explicitLevel,
1178 UINT8 resolvedLevel);
1180 HRESULT SetNumberSubstitution(
1181 UINT32 position,
1182 UINT32 length,
1183 IDWriteNumberSubstitution* substitution);
1187 local,
1188 object,
1189 uuid(b7e6163e-7f46-43b4-84b3-e4e6249c365d)
1191 interface IDWriteTextAnalyzer : IUnknown
1193 HRESULT AnalyzeScript(
1194 IDWriteTextAnalysisSource* source,
1195 UINT32 position,
1196 UINT32 length,
1197 IDWriteTextAnalysisSink* sink);
1199 HRESULT AnalyzeBidi(
1200 IDWriteTextAnalysisSource* source,
1201 UINT32 position,
1202 UINT32 length,
1203 IDWriteTextAnalysisSink* sink);
1205 HRESULT AnalyzeNumberSubstitution(
1206 IDWriteTextAnalysisSource* source,
1207 UINT32 position,
1208 UINT32 length,
1209 IDWriteTextAnalysisSink* sink);
1211 HRESULT AnalyzeLineBreakpoints(
1212 IDWriteTextAnalysisSource* source,
1213 UINT32 position,
1214 UINT32 length,
1215 IDWriteTextAnalysisSink* sink);
1217 HRESULT GetGlyphs(
1218 WCHAR const* text,
1219 UINT32 length,
1220 IDWriteFontFace* font_face,
1221 BOOL is_sideways,
1222 BOOL is_rtl,
1223 DWRITE_SCRIPT_ANALYSIS const* analysis,
1224 WCHAR const* locale,
1225 IDWriteNumberSubstitution* substitution,
1226 DWRITE_TYPOGRAPHIC_FEATURES const** features,
1227 UINT32 const* feature_range_len,
1228 UINT32 feature_ranges,
1229 UINT32 max_glyph_count,
1230 UINT16* clustermap,
1231 DWRITE_SHAPING_TEXT_PROPERTIES* text_props,
1232 UINT16* glyph_indices,
1233 DWRITE_SHAPING_GLYPH_PROPERTIES* glyph_props,
1234 UINT32* actual_glyph_count);
1236 HRESULT GetGlyphPlacements(
1237 WCHAR const* text,
1238 UINT16 const* clustermap,
1239 DWRITE_SHAPING_TEXT_PROPERTIES* props,
1240 UINT32 text_len,
1241 UINT16 const* glyph_indices,
1242 DWRITE_SHAPING_GLYPH_PROPERTIES const* glyph_props,
1243 UINT32 glyph_count,
1244 IDWriteFontFace * font_face,
1245 FLOAT fontEmSize,
1246 BOOL is_sideways,
1247 BOOL is_rtl,
1248 DWRITE_SCRIPT_ANALYSIS const* analysis,
1249 WCHAR const* locale,
1250 DWRITE_TYPOGRAPHIC_FEATURES const** features,
1251 UINT32 const* feature_range_len,
1252 UINT32 feature_ranges,
1253 FLOAT* glyph_advances,
1254 DWRITE_GLYPH_OFFSET* glyph_offsets);
1256 HRESULT GetGdiCompatibleGlyphPlacements(
1257 WCHAR const* text,
1258 UINT16 const* clustermap,
1259 DWRITE_SHAPING_TEXT_PROPERTIES* props,
1260 UINT32 text_len,
1261 UINT16 const* glyph_indices,
1262 DWRITE_SHAPING_GLYPH_PROPERTIES const* glyph_props,
1263 UINT32 glyph_count,
1264 IDWriteFontFace * font_face,
1265 FLOAT fontEmSize,
1266 FLOAT pixels_per_dip,
1267 DWRITE_MATRIX const* transform,
1268 BOOL use_gdi_natural,
1269 BOOL is_sideways,
1270 BOOL is_rtl,
1271 DWRITE_SCRIPT_ANALYSIS const* analysis,
1272 WCHAR const* locale,
1273 DWRITE_TYPOGRAPHIC_FEATURES const** features,
1274 UINT32 const* feature_range_lengths,
1275 UINT32 feature_ranges,
1276 FLOAT* glyph_advances,
1277 DWRITE_GLYPH_OFFSET* glyph_offsets);
1281 local,
1282 object,
1283 uuid(7d97dbf7-e085-42d4-81e3-6a883bded118)
1285 interface IDWriteGlyphRunAnalysis : IUnknown
1287 HRESULT GetAlphaTextureBounds(DWRITE_TEXTURE_TYPE type, RECT* bounds);
1288 HRESULT CreateAlphaTexture(DWRITE_TEXTURE_TYPE type, RECT const* bounds, BYTE* alphaValues, UINT32 bufferSize);
1289 HRESULT GetAlphaBlendParams(
1290 IDWriteRenderingParams* renderingParams,
1291 FLOAT* blendGamma,
1292 FLOAT* blendEnhancedContrast,
1293 FLOAT* blendClearTypeLevel);
1297 local,
1298 object,
1299 uuid(b859ee5a-d838-4b5b-a2e8-1adc7d93db48)
1301 interface IDWriteFactory : IUnknown
1303 HRESULT GetSystemFontCollection(IDWriteFontCollection **collection,
1304 [defaultvalue(FALSE)] BOOL check_for_updates);
1306 HRESULT CreateCustomFontCollection(
1307 IDWriteFontCollectionLoader *loader,
1308 void const *key,
1309 UINT32 key_size,
1310 IDWriteFontCollection **collection);
1312 HRESULT RegisterFontCollectionLoader(IDWriteFontCollectionLoader *loader);
1314 HRESULT UnregisterFontCollectionLoader(IDWriteFontCollectionLoader *loader);
1316 HRESULT CreateFontFileReference(
1317 WCHAR const *path,
1318 FILETIME const *writetime,
1319 IDWriteFontFile **font_file);
1321 HRESULT CreateCustomFontFileReference(
1322 void const *reference_key,
1323 UINT32 key_size,
1324 IDWriteFontFileLoader *loader,
1325 IDWriteFontFile **font_file);
1327 HRESULT CreateFontFace(
1328 DWRITE_FONT_FACE_TYPE facetype,
1329 UINT32 files_number,
1330 IDWriteFontFile* const* font_files,
1331 UINT32 index,
1332 DWRITE_FONT_SIMULATIONS sim_flags,
1333 IDWriteFontFace **font_face);
1335 HRESULT CreateRenderingParams(IDWriteRenderingParams **params);
1337 HRESULT CreateMonitorRenderingParams(
1338 HMONITOR monitor,
1339 IDWriteRenderingParams **params);
1341 HRESULT CreateCustomRenderingParams(
1342 FLOAT gamma,
1343 FLOAT enhancedContrast,
1344 FLOAT cleartype_level,
1345 DWRITE_PIXEL_GEOMETRY geometry,
1346 DWRITE_RENDERING_MODE mode,
1347 IDWriteRenderingParams **params);
1349 HRESULT RegisterFontFileLoader(IDWriteFontFileLoader *loader);
1351 HRESULT UnregisterFontFileLoader(IDWriteFontFileLoader *loader);
1353 HRESULT CreateTextFormat(
1354 WCHAR const* family_name,
1355 IDWriteFontCollection *collection,
1356 DWRITE_FONT_WEIGHT weight,
1357 DWRITE_FONT_STYLE style,
1358 DWRITE_FONT_STRETCH stretch,
1359 FLOAT size,
1360 WCHAR const *locale,
1361 IDWriteTextFormat **format);
1363 HRESULT CreateTypography(IDWriteTypography **typography);
1365 HRESULT GetGdiInterop(IDWriteGdiInterop **gdi_interop);
1367 HRESULT CreateTextLayout(
1368 WCHAR const* string,
1369 UINT32 len,
1370 IDWriteTextFormat *format,
1371 FLOAT max_width,
1372 FLOAT max_height,
1373 IDWriteTextLayout **layout);
1375 HRESULT CreateGdiCompatibleTextLayout(
1376 WCHAR const* string,
1377 UINT32 len,
1378 IDWriteTextFormat *format,
1379 FLOAT layout_width,
1380 FLOAT layout_height,
1381 FLOAT pixels_per_dip,
1382 DWRITE_MATRIX const* transform,
1383 BOOL use_gdi_natural,
1384 IDWriteTextLayout **layout);
1386 HRESULT CreateEllipsisTrimmingSign(
1387 IDWriteTextFormat *format,
1388 IDWriteInlineObject **trimming_sign);
1390 HRESULT CreateTextAnalyzer(IDWriteTextAnalyzer **analyzer);
1392 HRESULT CreateNumberSubstitution(
1393 DWRITE_NUMBER_SUBSTITUTION_METHOD method,
1394 WCHAR const* locale,
1395 BOOL ignore_user_override,
1396 IDWriteNumberSubstitution **substitution);
1398 HRESULT CreateGlyphRunAnalysis(
1399 DWRITE_GLYPH_RUN const *glyph_run,
1400 FLOAT pixels_per_dip,
1401 DWRITE_MATRIX const* transform,
1402 DWRITE_RENDERING_MODE rendering_mode,
1403 DWRITE_MEASURING_MODE measuring_mode,
1404 FLOAT baseline_x,
1405 FLOAT baseline_y,
1406 IDWriteGlyphRunAnalysis **analysis);
1409 cpp_quote("HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE,REFIID,IUnknown**);")
1411 /* error codes */
1412 cpp_quote("#define FACILITY_DWRITE 0x898")
1413 cpp_quote("#define DWRITE_ERR_BASE 0x5000")
1414 cpp_quote("#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code))")
1415 cpp_quote("#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)")
1417 cpp_quote("#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x0)")
1418 cpp_quote("#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x1)")
1419 cpp_quote("#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x2)")
1420 cpp_quote("#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x3)")
1421 cpp_quote("#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x4)")
1422 cpp_quote("#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x5)")
1423 cpp_quote("#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x6)")