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 IDWriteFontSetBuilder
;
25 interface IDWriteFontDownloadQueue
;
27 cpp_quote
("#ifndef _WINGDI_")
28 /* already defined in wingdi.h but needed for WIDL */
29 typedef struct FONTSIGNATURE FONTSIGNATURE
;
30 cpp_quote
("#endif /* _WINGDI_ */")
32 typedef enum DWRITE_LOCALITY
34 DWRITE_LOCALITY_REMOTE
,
35 DWRITE_LOCALITY_PARTIAL
,
39 typedef enum DWRITE_RENDERING_MODE1
41 DWRITE_RENDERING_MODE1_DEFAULT
,
42 DWRITE_RENDERING_MODE1_ALIASED
,
43 DWRITE_RENDERING_MODE1_GDI_CLASSIC
,
44 DWRITE_RENDERING_MODE1_GDI_NATURAL
,
45 DWRITE_RENDERING_MODE1_NATURAL
,
46 DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC
,
47 DWRITE_RENDERING_MODE1_OUTLINE
,
48 DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
49 } DWRITE_RENDERING_MODE1
;
51 typedef enum DWRITE_FONT_PROPERTY_ID
53 DWRITE_FONT_PROPERTY_ID_NONE
,
54 DWRITE_FONT_PROPERTY_ID_FAMILY_NAME
,
55 DWRITE_FONT_PROPERTY_ID_PREFERRED_FAMILY_NAME
,
56 DWRITE_FONT_PROPERTY_ID_FACE_NAME
,
57 DWRITE_FONT_PROPERTY_ID_FULL_NAME
,
58 DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME
,
59 DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME
,
60 DWRITE_FONT_PROPERTY_ID_DESIGN_SCRIPT_LANGUAGE_TAG
,
61 DWRITE_FONT_PROPERTY_ID_SEMANTIC_TAG
,
62 DWRITE_FONT_PROPERTY_ID_WEIGHT
,
63 DWRITE_FONT_PROPERTY_ID_STRETCH
,
64 DWRITE_FONT_PROPERTY_ID_STYLE
,
65 DWRITE_FONT_PROPERTY_ID_TOTAL
66 } DWRITE_FONT_PROPERTY_ID
;
68 typedef struct DWRITE_FONT_PROPERTY
70 DWRITE_FONT_PROPERTY_ID propertyId
;
71 WCHAR
const *propertyValue
;
72 WCHAR
const *localeName
;
73 } DWRITE_FONT_PROPERTY
;
78 uuid(b06fe5b9
-43ec
-4393-881b
-dbe4dc72fda7
)
80 interface IDWriteFontDownloadListener
: IUnknown
82 void DownloadCompleted
(IDWriteFontDownloadQueue
*queue
, IUnknown
*context
, HRESULT result
);
88 uuid(b71e6052
-5aea
-4fa3
-832e
-f60d431f7e91
)
90 interface IDWriteFontDownloadQueue
: IUnknown
92 HRESULT AddListener
(IDWriteFontDownloadListener
*listener
, UINT32
*token
);
93 HRESULT RemoveListener
(UINT32 token
);
95 HRESULT BeginDownload
(IUnknown
*context
);
96 HRESULT CancelDownload
();
97 UINT64 GetGenerationCount
();
103 uuid(b7924baa
-391b
-412a
-8c5c
-e44cc2d867dc
)
105 interface IDWriteRenderingParams3
: IDWriteRenderingParams2
107 DWRITE_RENDERING_MODE1 GetRenderingMode1
();
113 uuid(cfee3140
-1257-47ca
-8b85
-31bfcf3f2d0e
)
115 interface IDWriteStringList
: IUnknown
118 HRESULT GetLocaleNameLength
(UINT32 index
, UINT32
*length
);
119 HRESULT GetLocaleName
(UINT32 index
, WCHAR
*name
, UINT32 size
);
120 HRESULT GetStringLength
(UINT32 index
, UINT32
*length
);
121 HRESULT GetString
(UINT32 index
, WCHAR
*string, UINT32 size
);
127 uuid(53585141-d9f8
-4095-8321-d73cf6bd116b
)
129 interface IDWriteFontSet
: IUnknown
131 UINT32 GetFontCount
();
132 HRESULT GetFontFaceReference
(UINT32 index
, IDWriteFontFaceReference
**reference
);
133 HRESULT FindFontFaceReference
(IDWriteFontFaceReference
*reference
,
134 UINT32
*index
, BOOL
*exists
);
135 HRESULT FindFontFace
(IDWriteFontFace
*fontface
, UINT32
*index
, BOOL
*exists
);
136 HRESULT GetPropertyValues__
(DWRITE_FONT_PROPERTY_ID
id, IDWriteStringList
**values
);
137 HRESULT GetPropertyValues_
(DWRITE_FONT_PROPERTY_ID
id,
138 WCHAR
const *preferred_locales
, IDWriteStringList
**values
);
139 HRESULT GetPropertyValues
(UINT32 index
, DWRITE_FONT_PROPERTY_ID
id, BOOL
*exists
,
140 IDWriteLocalizedStrings
**values
);
141 HRESULT GetPropertyOccurrenceCount
(DWRITE_FONT_PROPERTY
const *property
, UINT32
*count
);
142 HRESULT GetMatchingFonts_
(WCHAR
const *family
, DWRITE_FONT_WEIGHT weight
, DWRITE_FONT_STRETCH stretch
,
143 DWRITE_FONT_STYLE style
, IDWriteFontSet
**fontset
);
144 HRESULT GetMatchingFonts
(DWRITE_FONT_PROPERTY
const *props
, UINT32 count
, IDWriteFontSet
**fontset
);
150 uuid(29748ed6
-8c9c
-4a6a
-be0b
-d912e8538944
)
152 interface IDWriteFont3
: IDWriteFont2
154 HRESULT CreateFontFace
(IDWriteFontFace3
**fontface
);
155 BOOL Equals
(IDWriteFont
*font
);
156 HRESULT GetFontFaceReference
(IDWriteFontFaceReference
**reference
);
157 BOOL HasCharacter
(UINT32 character
);
158 DWRITE_LOCALITY GetLocality
();
164 uuid(da20d8ef
-812a
-4c43
-9802-62ec4abd7adf
)
166 interface IDWriteFontFamily1
: IDWriteFontFamily
168 DWRITE_LOCALITY GetFontLocality
(UINT32 index
);
169 HRESULT GetFont
(UINT32 index
, IDWriteFont3
**font
);
170 HRESULT GetFontFaceReference
(UINT32 index
, IDWriteFontFaceReference
**reference
);
176 uuid(53585141-d9f8
-4095-8321-d73cf6bd116c
)
178 interface IDWriteFontCollection1
: IDWriteFontCollection
180 HRESULT GetFontSet
(IDWriteFontSet
**fontset
);
181 HRESULT GetFontFamily
(UINT32 index
, IDWriteFontFamily1
**family
);
187 uuid(5e7fa7ca
-dde3
-424c
-89f0
-9fcd6fed58cd
)
189 interface IDWriteFontFaceReference
: IUnknown
191 HRESULT CreateFontFace
(IDWriteFontFace3
**fontface
);
192 HRESULT CreateFontFaceWithSimulations
(DWRITE_FONT_SIMULATIONS simulations
,
193 IDWriteFontFace3
**fontface
);
194 BOOL Equals
(IDWriteFontFaceReference
*reference
);
195 UINT32 GetFontFaceIndex
();
196 DWRITE_FONT_SIMULATIONS GetSimulations
();
197 HRESULT GetFontFile
(IDWriteFontFile
**fontfile
);
198 UINT64 GetLocalFileSize
();
199 UINT64 GetFileSize
();
200 HRESULT GetFileTime
(FILETIME
*writetime
);
201 DWRITE_LOCALITY GetLocality
();
202 HRESULT EnqueueFontDownloadRequest
();
203 HRESULT EnqueueCharacterDownloadRequest
(WCHAR
const *chars
, UINT32 count
);
204 HRESULT EnqueueGlyphDownloadRequest
(UINT16
const *glyphs
, UINT32 count
);
205 HRESULT EnqueueFileFragmentDownloadRequest
(UINT64 offset
, UINT64 size
);
211 uuid(da20d8ef
-812a
-4c43
-9802-62ec4abd7ade
)
213 interface IDWriteFontList1
: IDWriteFontList
215 DWRITE_LOCALITY GetFontLocality
(UINT32 index
);
216 HRESULT GetFont
(UINT32 index
, IDWriteFont3
**font
);
217 HRESULT GetFontFaceReference
(UINT32 index
, IDWriteFontFaceReference
**reference
);
223 uuid(d37d7598
-09be
-4222-a236
-2081341cc1f2
)
225 interface IDWriteFontFace3
: IDWriteFontFace2
227 HRESULT GetFontFaceReference
(IDWriteFontFaceReference
**reference
);
228 void GetPanose
(DWRITE_PANOSE
*panose
);
229 DWRITE_FONT_WEIGHT GetWeight
();
230 DWRITE_FONT_STRETCH GetStretch
();
231 DWRITE_FONT_STYLE GetStyle
();
232 HRESULT GetFamilyNames
(IDWriteLocalizedStrings
**names
);
233 HRESULT GetFaceNames
(IDWriteLocalizedStrings
**names
);
234 HRESULT GetInformationalStrings
(DWRITE_INFORMATIONAL_STRING_ID stringid
,
235 IDWriteLocalizedStrings
**strings
,
237 BOOL HasCharacter
(UINT32 character
);
238 HRESULT GetRecommendedRenderingMode
(
242 DWRITE_MATRIX
const *transform
,
244 DWRITE_OUTLINE_THRESHOLD threshold
,
245 DWRITE_MEASURING_MODE measuring_mode
,
246 IDWriteRenderingParams
*params
,
247 DWRITE_RENDERING_MODE1
*rendering_mode
,
248 DWRITE_GRID_FIT_MODE
*gridfit_mode
);
249 BOOL IsCharacterLocal
(UINT32 character
);
250 BOOL IsGlyphLocal
(UINT16 glyph
);
251 HRESULT AreCharactersLocal
(WCHAR
const *characters
,
252 UINT32 count
, BOOL enqueue_if_not
, BOOL
*are_local
);
253 HRESULT AreGlyphsLocal
(UINT16
const *glyphs
, UINT32 count
,
254 BOOL enqueue_if_not
, BOOL
*are_local
);
258 typedef struct DWRITE_LINE_METRICS1
261 UINT32 trailingWhitespaceLength
;
262 UINT32 newlineLength
;
268 } DWRITE_LINE_METRICS1
;
270 typedef enum DWRITE_FONT_LINE_GAP_USAGE
272 DWRITE_FONT_LINE_GAP_USAGE_DEFAULT
,
273 DWRITE_FONT_LINE_GAP_USAGE_DISABLED
,
274 DWRITE_FONT_LINE_GAP_USAGE_ENABLED
275 } DWRITE_FONT_LINE_GAP_USAGE
;
277 typedef struct DWRITE_LINE_SPACING
279 DWRITE_LINE_SPACING_METHOD method
;
283 DWRITE_FONT_LINE_GAP_USAGE fontLineGapUsage
;
284 } DWRITE_LINE_SPACING
;
289 uuid(f67e0edd
-9e3d
-4ecc
-8c32
-4183253dfe70
)
291 interface IDWriteTextFormat2
: IDWriteTextFormat1
293 HRESULT SetLineSpacing
(DWRITE_LINE_SPACING
const *spacing
);
294 HRESULT GetLineSpacing
(DWRITE_LINE_SPACING
*spacing
);
300 uuid(07ddcd52
-020e-4de8
-ac33
-6c953d83f92d
)
302 interface IDWriteTextLayout3
: IDWriteTextLayout2
304 HRESULT InvalidateLayout
();
305 HRESULT SetLineSpacing
(DWRITE_LINE_SPACING
const *spacing
);
306 HRESULT GetLineSpacing
(DWRITE_LINE_SPACING
*spacing
);
307 HRESULT GetLineMetrics
(DWRITE_LINE_METRICS1
*metrics
, UINT32 max_count
, UINT32
*count
);
313 uuid(4556be70
-3abd
-4f70
-90be
-421780a6f515
)
315 interface IDWriteGdiInterop1
: IDWriteGdiInterop
317 HRESULT CreateFontFromLOGFONT
(LOGFONTW
const *logfont
,
318 IDWriteFontCollection
*collection
,
321 /* GetFontSignature() methods are listed in reversed order to make
322 resulting vtable order compatible. */
323 HRESULT GetFontSignature_
(IDWriteFontFace
*fontface
, FONTSIGNATURE
*fontsig
);
324 HRESULT GetFontSignature
(IDWriteFont
*font
, FONTSIGNATURE
*fontsig
);
325 HRESULT GetMatchingFontsByLOGFONT
(LOGFONTW
const *logfont
,
326 IDWriteFontSet
*fontset
,
327 IDWriteFontSet
**subset
);
333 uuid(9a1b41c3
-d3bb
-466a
-87fc
-fe67556a3b65
)
335 interface IDWriteFactory3
: IDWriteFactory2
337 HRESULT CreateGlyphRunAnalysis
(
338 DWRITE_GLYPH_RUN
const *run
,
339 DWRITE_MATRIX
const *transform
,
340 DWRITE_RENDERING_MODE1 rendering_mode
,
341 DWRITE_MEASURING_MODE measuring_mode
,
342 DWRITE_GRID_FIT_MODE gridfit_mode
,
343 DWRITE_TEXT_ANTIALIAS_MODE antialias_mode
,
346 IDWriteGlyphRunAnalysis
**analysis
);
348 HRESULT CreateCustomRenderingParams
(
350 FLOAT enhanced_contrast
,
351 FLOAT grayscale_enhanced_contrast
,
352 FLOAT cleartype_level
,
353 DWRITE_PIXEL_GEOMETRY pixel_geometry
,
354 DWRITE_RENDERING_MODE1 rendering_mode
,
355 DWRITE_GRID_FIT_MODE gridfit_mode
,
356 IDWriteRenderingParams3
**params
);
358 /* CreateFontFaceReference methods are listed in reversed order to make
359 resulting vtable order compatible. */
360 HRESULT CreateFontFaceReference_
(
361 IDWriteFontFile
*file
,
363 DWRITE_FONT_SIMULATIONS simulations
,
364 IDWriteFontFaceReference
**reference
);
366 HRESULT CreateFontFaceReference
(
368 FILETIME
const *writetime
,
370 DWRITE_FONT_SIMULATIONS simulations
,
371 IDWriteFontFaceReference
**reference
);
373 HRESULT GetSystemFontSet
(IDWriteFontSet
**fontset
);
374 HRESULT CreateFontSetBuilder
(IDWriteFontSetBuilder
**builder
);
375 HRESULT CreateFontCollectionFromFontSet
(
376 IDWriteFontSet
*fontset
,
377 IDWriteFontCollection1
**collection
);
379 HRESULT GetSystemFontCollection
(
380 BOOL include_downloadable
,
381 IDWriteFontCollection1
**collection
,
382 BOOL check_for_updates
);
384 HRESULT GetFontDownloadQueue
(IDWriteFontDownloadQueue
**queue
);