2 * Copyright 2016 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
"dwrite_2.idl";
21 interface IDWriteFontFaceReference
;
22 interface IDWriteFontFace3
;
23 interface IDWriteFontSet
;
24 interface IDWriteFontDownloadQueue
;
26 cpp_quote
("#ifndef _WINGDI_")
27 /* already defined in wingdi.h but needed for WIDL */
28 typedef struct FONTSIGNATURE FONTSIGNATURE
;
29 cpp_quote
("#endif /* _WINGDI_ */")
31 typedef enum DWRITE_LOCALITY
33 DWRITE_LOCALITY_REMOTE
,
34 DWRITE_LOCALITY_PARTIAL
,
38 typedef enum DWRITE_RENDERING_MODE1
40 DWRITE_RENDERING_MODE1_DEFAULT
,
41 DWRITE_RENDERING_MODE1_ALIASED
,
42 DWRITE_RENDERING_MODE1_GDI_CLASSIC
,
43 DWRITE_RENDERING_MODE1_GDI_NATURAL
,
44 DWRITE_RENDERING_MODE1_NATURAL
,
45 DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC
,
46 DWRITE_RENDERING_MODE1_OUTLINE
,
47 DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
48 } DWRITE_RENDERING_MODE1
;
50 typedef enum DWRITE_FONT_PROPERTY_ID
52 DWRITE_FONT_PROPERTY_ID_NONE
,
53 DWRITE_FONT_PROPERTY_ID_FAMILY_NAME
,
54 DWRITE_FONT_PROPERTY_ID_PREFERRED_FAMILY_NAME
,
55 DWRITE_FONT_PROPERTY_ID_FACE_NAME
,
56 DWRITE_FONT_PROPERTY_ID_FULL_NAME
,
57 DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME
,
58 DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME
,
59 DWRITE_FONT_PROPERTY_ID_DESIGN_SCRIPT_LANGUAGE_TAG
,
60 DWRITE_FONT_PROPERTY_ID_SEMANTIC_TAG
,
61 DWRITE_FONT_PROPERTY_ID_WEIGHT
,
62 DWRITE_FONT_PROPERTY_ID_STRETCH
,
63 DWRITE_FONT_PROPERTY_ID_STYLE
,
64 DWRITE_FONT_PROPERTY_ID_TOTAL
65 } DWRITE_FONT_PROPERTY_ID
;
67 typedef struct DWRITE_FONT_PROPERTY
69 DWRITE_FONT_PROPERTY_ID propertyId
;
70 WCHAR
const *propertyValue
;
71 WCHAR
const *localeName
;
72 } DWRITE_FONT_PROPERTY
;
77 uuid(b06fe5b9
-43ec
-4393-881b
-dbe4dc72fda7
)
79 interface IDWriteFontDownloadListener
: IUnknown
81 void DownloadCompleted
(IDWriteFontDownloadQueue
*queue
, IUnknown
*context
, HRESULT result
);
87 uuid(b71e6052
-5aea
-4fa3
-832e
-f60d431f7e91
)
89 interface IDWriteFontDownloadQueue
: IUnknown
91 HRESULT AddListener
(IDWriteFontDownloadListener
*listener
, UINT32
*token
);
92 HRESULT RemoveListener
(UINT32 token
);
94 HRESULT BeginDownload
(IUnknown
*context
);
95 HRESULT CancelDownload
();
96 UINT64 GetGenerationCount
();
102 uuid(b7924baa
-391b
-412a
-8c5c
-e44cc2d867dc
)
104 interface IDWriteRenderingParams3
: IDWriteRenderingParams2
106 DWRITE_RENDERING_MODE1 GetRenderingMode1
();
112 uuid(cfee3140
-1257-47ca
-8b85
-31bfcf3f2d0e
)
114 interface IDWriteStringList
: IUnknown
117 HRESULT GetLocaleNameLength
(UINT32 index
, UINT32
*length
);
118 HRESULT GetLocaleName
(UINT32 index
, WCHAR
*name
, UINT32 size
);
119 HRESULT GetStringLength
(UINT32 index
, UINT32
*length
);
120 HRESULT GetString
(UINT32 index
, WCHAR
*string, UINT32 size
);
126 uuid(53585141-d9f8
-4095-8321-d73cf6bd116b
)
128 interface IDWriteFontSet
: IUnknown
130 UINT32 GetFontCount
();
131 HRESULT GetFontFaceReference
(UINT32 index
, IDWriteFontFaceReference
**reference
);
132 HRESULT FindFontFaceReference
(IDWriteFontFaceReference
*reference
,
133 UINT32
*index
, BOOL
*exists
);
134 HRESULT FindFontFace
(IDWriteFontFace
*fontface
, UINT32
*index
, BOOL
*exists
);
135 HRESULT GetPropertyValues__
(DWRITE_FONT_PROPERTY_ID
id, IDWriteStringList
**values
);
136 HRESULT GetPropertyValues_
(DWRITE_FONT_PROPERTY_ID
id,
137 WCHAR
const *preferred_locales
, IDWriteStringList
**values
);
138 HRESULT GetPropertyValues
(UINT32 index
, DWRITE_FONT_PROPERTY_ID
id, BOOL
*exists
,
139 IDWriteLocalizedStrings
**values
);
140 HRESULT GetPropertyOccurrenceCount
(DWRITE_FONT_PROPERTY
const *property
, UINT32
*count
);
141 HRESULT GetMatchingFonts_
(WCHAR
const *family
, DWRITE_FONT_WEIGHT weight
, DWRITE_FONT_STRETCH stretch
,
142 DWRITE_FONT_STYLE style
, IDWriteFontSet
**fontset
);
143 HRESULT GetMatchingFonts
(DWRITE_FONT_PROPERTY
const *props
, UINT32 count
, IDWriteFontSet
**fontset
);
149 uuid(29748ed6
-8c9c
-4a6a
-be0b
-d912e8538944
)
151 interface IDWriteFont3
: IDWriteFont2
153 HRESULT CreateFontFace
(IDWriteFontFace3
**fontface
);
154 BOOL Equals
(IDWriteFont
*font
);
155 HRESULT GetFontFaceReference
(IDWriteFontFaceReference
**reference
);
156 BOOL HasCharacter
(UINT32 character
);
157 DWRITE_LOCALITY GetLocality
();
163 uuid(da20d8ef
-812a
-4c43
-9802-62ec4abd7adf
)
165 interface IDWriteFontFamily1
: IDWriteFontFamily
167 DWRITE_LOCALITY GetFontLocality
(UINT32 index
);
168 HRESULT GetFont
(UINT32 index
, IDWriteFont3
**font
);
169 HRESULT GetFontFaceReference
(UINT32 index
, IDWriteFontFaceReference
**reference
);
175 uuid(53585141-d9f8
-4095-8321-d73cf6bd116c
)
177 interface IDWriteFontCollection1
: IDWriteFontCollection
179 HRESULT GetFontSet
(IDWriteFontSet
**fontset
);
180 HRESULT GetFontFamily
(UINT32 index
, IDWriteFontFamily1
**family
);
186 uuid(5e7fa7ca
-dde3
-424c
-89f0
-9fcd6fed58cd
)
188 interface IDWriteFontFaceReference
: IUnknown
190 HRESULT CreateFontFace
(IDWriteFontFace3
**fontface
);
191 HRESULT CreateFontFaceWithSimulations
(DWRITE_FONT_SIMULATIONS simulations
,
192 IDWriteFontFace3
**fontface
);
193 BOOL Equals
(IDWriteFontFaceReference
*reference
);
194 UINT32 GetFontFaceIndex
();
195 DWRITE_FONT_SIMULATIONS GetSimulations
();
196 HRESULT GetFontFile
(IDWriteFontFile
**fontfile
);
197 UINT64 GetLocalFileSize
();
198 UINT64 GetFileSize
();
199 HRESULT GetFileTime
(FILETIME
*writetime
);
200 DWRITE_LOCALITY GetLocality
();
201 HRESULT EnqueueFontDownloadRequest
();
202 HRESULT EnqueueCharacterDownloadRequest
(WCHAR
const *chars
, UINT32 count
);
203 HRESULT EnqueueGlyphDownloadRequest
(UINT16
const *glyphs
, UINT32 count
);
204 HRESULT EnqueueFileFragmentDownloadRequest
(UINT64 offset
, UINT64 size
);
210 uuid(da20d8ef
-812a
-4c43
-9802-62ec4abd7ade
)
212 interface IDWriteFontList1
: IDWriteFontList
214 DWRITE_LOCALITY GetFontLocality
(UINT32 index
);
215 HRESULT GetFont
(UINT32 index
, IDWriteFont3
**font
);
216 HRESULT GetFontFaceReference
(UINT32 index
, IDWriteFontFaceReference
**reference
);
222 uuid(d37d7598
-09be
-4222-a236
-2081341cc1f2
)
224 interface IDWriteFontFace3
: IDWriteFontFace2
226 HRESULT GetFontFaceReference
(IDWriteFontFaceReference
**reference
);
227 void GetPanose
(DWRITE_PANOSE
*panose
);
228 DWRITE_FONT_WEIGHT GetWeight
();
229 DWRITE_FONT_STRETCH GetStretch
();
230 DWRITE_FONT_STYLE GetStyle
();
231 HRESULT GetFamilyNames
(IDWriteLocalizedStrings
**names
);
232 HRESULT GetFaceNames
(IDWriteLocalizedStrings
**names
);
233 HRESULT GetInformationalStrings
(DWRITE_INFORMATIONAL_STRING_ID stringid
,
234 IDWriteLocalizedStrings
**strings
,
236 BOOL HasCharacter
(UINT32 character
);
237 HRESULT GetRecommendedRenderingMode
(
241 DWRITE_MATRIX
const *transform
,
243 DWRITE_OUTLINE_THRESHOLD threshold
,
244 DWRITE_MEASURING_MODE measuring_mode
,
245 IDWriteRenderingParams
*params
,
246 DWRITE_RENDERING_MODE1
*rendering_mode
,
247 DWRITE_GRID_FIT_MODE
*gridfit_mode
);
248 BOOL IsCharacterLocal
(UINT32 character
);
249 BOOL IsGlyphLocal
(UINT16 glyph
);
250 HRESULT AreCharactersLocal
(WCHAR
const *characters
,
251 UINT32 count
, BOOL enqueue_if_not
, BOOL
*are_local
);
252 HRESULT AreGlyphsLocal
(UINT16
const *glyphs
, UINT32 count
,
253 BOOL enqueue_if_not
, BOOL
*are_local
);
257 typedef struct DWRITE_LINE_METRICS1
260 UINT32 trailingWhitespaceLength
;
261 UINT32 newlineLength
;
267 } DWRITE_LINE_METRICS1
;
269 typedef enum DWRITE_FONT_LINE_GAP_USAGE
271 DWRITE_FONT_LINE_GAP_USAGE_DEFAULT
,
272 DWRITE_FONT_LINE_GAP_USAGE_DISABLED
,
273 DWRITE_FONT_LINE_GAP_USAGE_ENABLED
274 } DWRITE_FONT_LINE_GAP_USAGE
;
276 typedef struct DWRITE_LINE_SPACING
278 DWRITE_LINE_SPACING_METHOD method
;
282 DWRITE_FONT_LINE_GAP_USAGE fontLineGapUsage
;
283 } DWRITE_LINE_SPACING
;
288 uuid(f67e0edd
-9e3d
-4ecc
-8c32
-4183253dfe70
)
290 interface IDWriteTextFormat2
: IDWriteTextFormat1
292 HRESULT SetLineSpacing
(DWRITE_LINE_SPACING
const *spacing
);
293 HRESULT GetLineSpacing
(DWRITE_LINE_SPACING
*spacing
);
299 uuid(07ddcd52
-020e-4de8
-ac33
-6c953d83f92d
)
301 interface IDWriteTextLayout3
: IDWriteTextLayout2
303 HRESULT InvalidateLayout
();
304 HRESULT SetLineSpacing
(DWRITE_LINE_SPACING
const *spacing
);
305 HRESULT GetLineSpacing
(DWRITE_LINE_SPACING
*spacing
);
306 HRESULT GetLineMetrics
(DWRITE_LINE_METRICS1
*metrics
, UINT32 max_count
, UINT32
*count
);
312 uuid(4556be70
-3abd
-4f70
-90be
-421780a6f515
)
314 interface IDWriteGdiInterop1
: IDWriteGdiInterop
316 HRESULT CreateFontFromLOGFONT
(LOGFONTW
const *logfont
,
317 IDWriteFontCollection
*collection
,
320 /* GetFontSignature() methods are listed in reversed order to make
321 resulting vtable order compatible. */
322 HRESULT GetFontSignature_
(IDWriteFontFace
*fontface
, FONTSIGNATURE
*fontsig
);
323 HRESULT GetFontSignature
(IDWriteFont
*font
, FONTSIGNATURE
*fontsig
);
324 HRESULT GetMatchingFontsByLOGFONT
(LOGFONTW
const *logfont
,
325 IDWriteFontSet
*fontset
,
326 IDWriteFontSet
**subset
);
332 uuid(2f642afe
-9c68
-4f40
-b8be
-457401afcb3d
)
334 interface IDWriteFontSetBuilder
: IUnknown
336 HRESULT AddFontFaceReference_
(IDWriteFontFaceReference
*ref,
337 DWRITE_FONT_PROPERTY
const *props
,
339 HRESULT AddFontFaceReference
(IDWriteFontFaceReference
*ref);
340 HRESULT AddFontSet
(IDWriteFontSet
*fontset
);
341 HRESULT CreateFontSet
(IDWriteFontSet
**fontset
);
347 uuid(9a1b41c3
-d3bb
-466a
-87fc
-fe67556a3b65
)
349 interface IDWriteFactory3
: IDWriteFactory2
351 HRESULT CreateGlyphRunAnalysis
(
352 DWRITE_GLYPH_RUN
const *run
,
353 DWRITE_MATRIX
const *transform
,
354 DWRITE_RENDERING_MODE1 rendering_mode
,
355 DWRITE_MEASURING_MODE measuring_mode
,
356 DWRITE_GRID_FIT_MODE gridfit_mode
,
357 DWRITE_TEXT_ANTIALIAS_MODE antialias_mode
,
360 IDWriteGlyphRunAnalysis
**analysis
);
362 HRESULT CreateCustomRenderingParams
(
364 FLOAT enhanced_contrast
,
365 FLOAT grayscale_enhanced_contrast
,
366 FLOAT cleartype_level
,
367 DWRITE_PIXEL_GEOMETRY pixel_geometry
,
368 DWRITE_RENDERING_MODE1 rendering_mode
,
369 DWRITE_GRID_FIT_MODE gridfit_mode
,
370 IDWriteRenderingParams3
**params
);
372 /* CreateFontFaceReference methods are listed in reversed order to make
373 resulting vtable order compatible. */
374 HRESULT CreateFontFaceReference_
(
375 IDWriteFontFile
*file
,
377 DWRITE_FONT_SIMULATIONS simulations
,
378 IDWriteFontFaceReference
**reference
);
380 HRESULT CreateFontFaceReference
(
382 FILETIME
const *writetime
,
384 DWRITE_FONT_SIMULATIONS simulations
,
385 IDWriteFontFaceReference
**reference
);
387 HRESULT GetSystemFontSet
(IDWriteFontSet
**fontset
);
388 HRESULT CreateFontSetBuilder
(IDWriteFontSetBuilder
**builder
);
389 HRESULT CreateFontCollectionFromFontSet
(
390 IDWriteFontSet
*fontset
,
391 IDWriteFontCollection1
**collection
);
393 HRESULT GetSystemFontCollection
(
394 BOOL include_downloadable
,
395 IDWriteFontCollection1
**collection
,
396 BOOL check_for_updates
);
398 HRESULT GetFontDownloadQueue
(IDWriteFontDownloadQueue
**queue
);
401 typedef enum DWRITE_GLYPH_IMAGE_FORMATS
403 DWRITE_GLYPH_IMAGE_FORMATS_NONE
= 0,
404 DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE
= 1 << 0,
405 DWRITE_GLYPH_IMAGE_FORMATS_CFF
= 1 << 1,
406 DWRITE_GLYPH_IMAGE_FORMATS_COLR
= 1 << 2,
407 DWRITE_GLYPH_IMAGE_FORMATS_SVG
= 1 << 3,
408 DWRITE_GLYPH_IMAGE_FORMATS_PNG
= 1 << 4,
409 DWRITE_GLYPH_IMAGE_FORMATS_JPEG
= 1 << 5,
410 DWRITE_GLYPH_IMAGE_FORMATS_TIFF
= 1 << 6,
411 DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8
= 1 << 7
412 } DWRITE_GLYPH_IMAGE_FORMATS
;
414 typedef struct DWRITE_GLYPH_IMAGE_DATA
416 void const *imageData
;
417 UINT32 imageDataSize
;
420 D2D1_SIZE_U pixelSize
;
421 D2D1_POINT_2L horizontalLeftOrigin
;
422 D2D1_POINT_2L horizontalRightOrigin
;
423 D2D1_POINT_2L verticalTopOrigin
;
424 D2D1_POINT_2L verticalBottomOrigin
;
425 } DWRITE_GLYPH_IMAGE_DATA
;
430 uuid(27f2a904
-4eb8
-441d
-9678-0563f53e3e2f
)
432 interface IDWriteFontFace4
: IDWriteFontFace3
434 HRESULT GetGlyphImageFormats_
(
438 DWRITE_GLYPH_IMAGE_FORMATS
*formats
);
439 DWRITE_GLYPH_IMAGE_FORMATS GetGlyphImageFormats
();
440 HRESULT GetGlyphImageData
(
443 DWRITE_GLYPH_IMAGE_FORMATS format
,
444 DWRITE_GLYPH_IMAGE_DATA
*data
,
446 void ReleaseGlyphImageData
(void *context
);
449 typedef struct DWRITE_COLOR_GLYPH_RUN1
451 DWRITE_GLYPH_RUN glyphRun
;
452 DWRITE_GLYPH_RUN_DESCRIPTION
*glyphRunDescription
;
453 FLOAT baselineOriginX
;
454 FLOAT baselineOriginY
;
455 DWRITE_COLOR_F runColor
;
457 DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat
;
458 DWRITE_MEASURING_MODE measuringMode
;
459 } DWRITE_COLOR_GLYPH_RUN1
;
464 uuid(7c5f86da
-c7a1
-4f05
-b8e1
-55a179fe5a35
)
466 interface IDWriteColorGlyphRunEnumerator1
: IDWriteColorGlyphRunEnumerator
468 HRESULT GetCurrentRun
(
469 DWRITE_COLOR_GLYPH_RUN1
const **run
);
475 uuid(4b0b5bd3
-0797-4549-8ac5
-fe915cc53856
)
477 interface IDWriteFactory4
: IDWriteFactory3
479 HRESULT TranslateColorGlyphRun
(
480 D2D1_POINT_2F baseline_origin
,
481 DWRITE_GLYPH_RUN
const *run
,
482 DWRITE_GLYPH_RUN_DESCRIPTION
const *run_desc
,
483 DWRITE_GLYPH_IMAGE_FORMATS desired_formats
,
484 DWRITE_MEASURING_MODE measuring_mode
,
485 DWRITE_MATRIX
const *transform
,
487 IDWriteColorGlyphRunEnumerator1
**layers
);
489 HRESULT ComputeGlyphOrigins_
(
490 DWRITE_GLYPH_RUN
const *run
,
491 D2D1_POINT_2F baseline_origin
,
492 D2D1_POINT_2F
*origins
);
494 HRESULT ComputeGlyphOrigins
(
495 DWRITE_GLYPH_RUN
const *run
,
496 DWRITE_MEASURING_MODE measuring_mode
,
497 D2D1_POINT_2F baseline_origin
,
498 DWRITE_MATRIX
const *transform
,
499 D2D1_POINT_2F
*origins
);