1 | /*
|
---|
2 | * Copyright 2014 Nikolay Sivov for CodeWeavers
|
---|
3 | *
|
---|
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.
|
---|
8 | *
|
---|
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.
|
---|
13 | *
|
---|
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
|
---|
17 | */
|
---|
18 |
|
---|
19 | import "dwrite_1.idl";
|
---|
20 |
|
---|
21 | typedef enum DWRITE_OPTICAL_ALIGNMENT
|
---|
22 | {
|
---|
23 | DWRITE_OPTICAL_ALIGNMENT_NONE,
|
---|
24 | DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS
|
---|
25 | } DWRITE_OPTICAL_ALIGNMENT;
|
---|
26 |
|
---|
27 | typedef enum DWRITE_GRID_FIT_MODE
|
---|
28 | {
|
---|
29 | DWRITE_GRID_FIT_MODE_DEFAULT,
|
---|
30 | DWRITE_GRID_FIT_MODE_DISABLED,
|
---|
31 | DWRITE_GRID_FIT_MODE_ENABLED
|
---|
32 | } DWRITE_GRID_FIT_MODE;
|
---|
33 |
|
---|
34 | typedef struct DWRITE_TEXT_METRICS1
|
---|
35 | {
|
---|
36 | /* DWRITE_TEXT_METRICS fields */
|
---|
37 | FLOAT left;
|
---|
38 | FLOAT top;
|
---|
39 | FLOAT width;
|
---|
40 | FLOAT widthIncludingTrailingWhitespace;
|
---|
41 | FLOAT height;
|
---|
42 | FLOAT layoutWidth;
|
---|
43 | FLOAT layoutHeight;
|
---|
44 | UINT32 maxBidiReorderingDepth;
|
---|
45 | UINT32 lineCount;
|
---|
46 | /* DWRITE_TEXT_METRICS1 fields */
|
---|
47 | FLOAT heightIncludingTrailingWhitespace;
|
---|
48 | } DWRITE_TEXT_METRICS1;
|
---|
49 |
|
---|
50 | cpp_quote("#ifndef D3DCOLORVALUE_DEFINED")
|
---|
51 | typedef struct _D3DCOLORVALUE
|
---|
52 | {
|
---|
53 | union {
|
---|
54 | FLOAT r;
|
---|
55 | FLOAT dvR;
|
---|
56 | };
|
---|
57 | union {
|
---|
58 | FLOAT g;
|
---|
59 | FLOAT dvG;
|
---|
60 | };
|
---|
61 | union {
|
---|
62 | FLOAT b;
|
---|
63 | FLOAT dvB;
|
---|
64 | };
|
---|
65 | union {
|
---|
66 | FLOAT a;
|
---|
67 | FLOAT dvA;
|
---|
68 | };
|
---|
69 | } D3DCOLORVALUE;
|
---|
70 | cpp_quote("#define D3DCOLORVALUE_DEFINED")
|
---|
71 | cpp_quote("#endif")
|
---|
72 |
|
---|
73 | typedef D3DCOLORVALUE DWRITE_COLOR_F;
|
---|
74 |
|
---|
75 | typedef struct DWRITE_COLOR_GLYPH_RUN
|
---|
76 | {
|
---|
77 | DWRITE_GLYPH_RUN glyphRun;
|
---|
78 | DWRITE_GLYPH_RUN_DESCRIPTION* glyphRunDescription;
|
---|
79 | FLOAT baselineOriginX;
|
---|
80 | FLOAT baselineOriginY;
|
---|
81 | DWRITE_COLOR_F runColor;
|
---|
82 | UINT16 paletteIndex;
|
---|
83 | } DWRITE_COLOR_GLYPH_RUN;
|
---|
84 |
|
---|
85 | [
|
---|
86 | local,
|
---|
87 | object,
|
---|
88 | uuid(d3e0e934-22a0-427e-aae4-7d9574b59db1)
|
---|
89 | ]
|
---|
90 | interface IDWriteTextRenderer1 : IDWriteTextRenderer
|
---|
91 | {
|
---|
92 | HRESULT DrawGlyphRun(void *context,
|
---|
93 | FLOAT originX,
|
---|
94 | FLOAT originY,
|
---|
95 | DWRITE_GLYPH_ORIENTATION_ANGLE angle,
|
---|
96 | DWRITE_MEASURING_MODE mode,
|
---|
97 | DWRITE_GLYPH_RUN const *run,
|
---|
98 | DWRITE_GLYPH_RUN_DESCRIPTION const *rundescr,
|
---|
99 | IUnknown *effect);
|
---|
100 |
|
---|
101 | HRESULT DrawUnderline(void *context,
|
---|
102 | FLOAT originX,
|
---|
103 | FLOAT originY,
|
---|
104 | DWRITE_GLYPH_ORIENTATION_ANGLE angle,
|
---|
105 | DWRITE_UNDERLINE const *underline,
|
---|
106 | IUnknown *effect);
|
---|
107 |
|
---|
108 | HRESULT DrawStrikethrough(void *context,
|
---|
109 | FLOAT originX,
|
---|
110 | FLOAT originY,
|
---|
111 | DWRITE_GLYPH_ORIENTATION_ANGLE angle,
|
---|
112 | DWRITE_STRIKETHROUGH const *strikethrough,
|
---|
113 | IUnknown *effect
|
---|
114 | );
|
---|
115 |
|
---|
116 | HRESULT DrawInlineObject(void *context,
|
---|
117 | FLOAT originX,
|
---|
118 | FLOAT originY,
|
---|
119 | DWRITE_GLYPH_ORIENTATION_ANGLE angle,
|
---|
120 | IDWriteInlineObject *inlineObject,
|
---|
121 | BOOL is_sideways,
|
---|
122 | BOOL is_rtl,
|
---|
123 | IUnknown *effect
|
---|
124 | );
|
---|
125 | }
|
---|
126 |
|
---|
127 | [
|
---|
128 | local,
|
---|
129 | object,
|
---|
130 | uuid(efa008f9-f7a1-48bf-b05c-f224713cc0ff)
|
---|
131 | ]
|
---|
132 | interface IDWriteFontFallback : IUnknown
|
---|
133 | {
|
---|
134 | HRESULT MapCharacters(IDWriteTextAnalysisSource *source,
|
---|
135 | UINT32 position,
|
---|
136 | UINT32 length,
|
---|
137 | IDWriteFontCollection *basecollection,
|
---|
138 | const WCHAR *baseFamilyName,
|
---|
139 | DWRITE_FONT_WEIGHT baseWeight,
|
---|
140 | DWRITE_FONT_STYLE baseStyle,
|
---|
141 | DWRITE_FONT_STRETCH baseStretch,
|
---|
142 | UINT32 *mappedLength,
|
---|
143 | IDWriteFont **mappedFont,
|
---|
144 | FLOAT *scale
|
---|
145 | );
|
---|
146 | }
|
---|
147 |
|
---|
148 | [
|
---|
149 | local,
|
---|
150 | object,
|
---|
151 | uuid(5f174b49-0d8b-4cfb-8bca-f1cce9d06c67)
|
---|
152 | ]
|
---|
153 | interface IDWriteTextFormat1 : IDWriteTextFormat
|
---|
154 | {
|
---|
155 | HRESULT SetVerticalGlyphOrientation(DWRITE_VERTICAL_GLYPH_ORIENTATION orientation);
|
---|
156 | DWRITE_VERTICAL_GLYPH_ORIENTATION GetVerticalGlyphOrientation();
|
---|
157 | HRESULT SetLastLineWrapping(BOOL lastline_wrapping_enabled);
|
---|
158 | BOOL GetLastLineWrapping();
|
---|
159 | HRESULT SetOpticalAlignment(DWRITE_OPTICAL_ALIGNMENT alignment);
|
---|
160 | DWRITE_OPTICAL_ALIGNMENT GetOpticalAlignment();
|
---|
161 | HRESULT SetFontFallback(IDWriteFontFallback *fallback);
|
---|
162 | HRESULT GetFontFallback(IDWriteFontFallback **fallback);
|
---|
163 | }
|
---|
164 |
|
---|
165 | [
|
---|
166 | local,
|
---|
167 | object,
|
---|
168 | uuid(1093c18f-8d5e-43f0-b064-0917311b525e)
|
---|
169 | ]
|
---|
170 | interface IDWriteTextLayout2 : IDWriteTextLayout1
|
---|
171 | {
|
---|
172 | HRESULT GetMetrics(DWRITE_TEXT_METRICS1 *metrics);
|
---|
173 | HRESULT SetVerticalGlyphOrientation(DWRITE_VERTICAL_GLYPH_ORIENTATION orientation);
|
---|
174 | DWRITE_VERTICAL_GLYPH_ORIENTATION GetVerticalGlyphOrientation();
|
---|
175 | HRESULT SetLastLineWrapping(BOOL lastline_wrapping_enabled);
|
---|
176 | BOOL GetLastLineWrapping();
|
---|
177 | HRESULT SetOpticalAlignment(DWRITE_OPTICAL_ALIGNMENT alignment);
|
---|
178 | DWRITE_OPTICAL_ALIGNMENT GetOpticalAlignment();
|
---|
179 | HRESULT SetFontFallback(IDWriteFontFallback *fallback);
|
---|
180 | HRESULT GetFontFallback(IDWriteFontFallback **fallback);
|
---|
181 | }
|
---|
182 |
|
---|
183 | [
|
---|
184 | local,
|
---|
185 | object,
|
---|
186 | uuid(553a9ff3-5693-4df7-b52b-74806f7f2eb9)
|
---|
187 | ]
|
---|
188 | interface IDWriteTextAnalyzer2 : IDWriteTextAnalyzer1
|
---|
189 | {
|
---|
190 | HRESULT GetGlyphOrientationTransform(DWRITE_GLYPH_ORIENTATION_ANGLE angle,
|
---|
191 | BOOL is_sideways,
|
---|
192 | FLOAT originX,
|
---|
193 | FLOAT originY,
|
---|
194 | DWRITE_MATRIX *transform
|
---|
195 | );
|
---|
196 | HRESULT GetTypographicFeatures(IDWriteFontFace *fontface,
|
---|
197 | DWRITE_SCRIPT_ANALYSIS analysis,
|
---|
198 | const WCHAR *localeName,
|
---|
199 | UINT32 max_tagcount,
|
---|
200 | UINT32 *actual_tagcount,
|
---|
201 | DWRITE_FONT_FEATURE_TAG *tags
|
---|
202 | );
|
---|
203 |
|
---|
204 | HRESULT CheckTypographicFeature(IDWriteFontFace *fontface,
|
---|
205 | DWRITE_SCRIPT_ANALYSIS analysis,
|
---|
206 | const WCHAR *localeName,
|
---|
207 | DWRITE_FONT_FEATURE_TAG feature,
|
---|
208 | UINT32 glyph_count,
|
---|
209 | const UINT16 *indices,
|
---|
210 | UINT8 *feature_applies
|
---|
211 | );
|
---|
212 | }
|
---|
213 |
|
---|
214 | [
|
---|
215 | local,
|
---|
216 | object,
|
---|
217 | uuid(fd882d06-8aba-4fb8-b849-8be8b73e14de)
|
---|
218 | ]
|
---|
219 | interface IDWriteFontFallbackBuilder : IUnknown
|
---|
220 | {
|
---|
221 | HRESULT AddMapping(const DWRITE_UNICODE_RANGE *ranges,
|
---|
222 | UINT32 rangesCount,
|
---|
223 | WCHAR const **targetFamilyNames,
|
---|
224 | UINT32 targetFamilyNamesCount,
|
---|
225 | [defaultvalue(NULL)] IDWriteFontCollection *collection,
|
---|
226 | [defaultvalue(NULL)] WCHAR const *localeName,
|
---|
227 | [defaultvalue(NULL)] WCHAR const *baseFamilyName,
|
---|
228 | [defaultvalue(1)] FLOAT scale
|
---|
229 | );
|
---|
230 | HRESULT AddMappings(IDWriteFontFallback *fallback);
|
---|
231 | HRESULT CreateFontFallback(IDWriteFontFallback **fallback);
|
---|
232 | }
|
---|
233 |
|
---|
234 | [
|
---|
235 | local,
|
---|
236 | object,
|
---|
237 | uuid(29748ed6-8c9c-4a6a-be0b-d912e8538944)
|
---|
238 | ]
|
---|
239 | interface IDWriteFont2 : IDWriteFont1
|
---|
240 | {
|
---|
241 | BOOL IsColorFont();
|
---|
242 | }
|
---|
243 |
|
---|
244 | [
|
---|
245 | local,
|
---|
246 | object,
|
---|
247 | uuid(d8b768ff-64bc-4e66-982b-ec8e87f693f7)
|
---|
248 | ]
|
---|
249 | interface IDWriteFontFace2 : IDWriteFontFace1
|
---|
250 | {
|
---|
251 | BOOL IsColorFont();
|
---|
252 | UINT32 GetColorPaletteCount();
|
---|
253 | UINT32 GetPaletteEntryCount();
|
---|
254 | HRESULT GetPaletteEntries(UINT32 palette_index,
|
---|
255 | UINT32 first_entry_index,
|
---|
256 | UINT32 entry_count,
|
---|
257 | DWRITE_COLOR_F *entries
|
---|
258 | );
|
---|
259 | HRESULT GetRecommendedRenderingMode(FLOAT fontEmSize,
|
---|
260 | FLOAT dpiX,
|
---|
261 | FLOAT dpiY,
|
---|
262 | DWRITE_MATRIX const *transform,
|
---|
263 | BOOL is_sideways,
|
---|
264 | DWRITE_OUTLINE_THRESHOLD threshold,
|
---|
265 | DWRITE_MEASURING_MODE measuringmode,
|
---|
266 | IDWriteRenderingParams *params,
|
---|
267 | DWRITE_RENDERING_MODE *renderingmode,
|
---|
268 | DWRITE_GRID_FIT_MODE *gridfitmode
|
---|
269 | );
|
---|
270 | }
|
---|
271 |
|
---|
272 | [
|
---|
273 | local,
|
---|
274 | object,
|
---|
275 | uuid(d31fbe17-f157-41a2-8d24-cb779e0560e8)
|
---|
276 | ]
|
---|
277 | interface IDWriteColorGlyphRunEnumerator : IUnknown
|
---|
278 | {
|
---|
279 | HRESULT MoveNext(BOOL *hasRun);
|
---|
280 | HRESULT GetCurrentRun(DWRITE_COLOR_GLYPH_RUN const **run);
|
---|
281 | }
|
---|
282 |
|
---|
283 | [
|
---|
284 | local,
|
---|
285 | object,
|
---|
286 | uuid(f9d711c3-9777-40ae-87e8-3e5aF9bf0948)
|
---|
287 | ]
|
---|
288 | interface IDWriteRenderingParams2 : IDWriteRenderingParams1
|
---|
289 | {
|
---|
290 | DWRITE_GRID_FIT_MODE GetGridFitMode();
|
---|
291 | }
|
---|
292 |
|
---|
293 | [
|
---|
294 | local,
|
---|
295 | object,
|
---|
296 | uuid(0439fc60-ca44-4994-8dee-3a9af7b732ec)
|
---|
297 | ]
|
---|
298 | interface IDWriteFactory2 : IDWriteFactory1
|
---|
299 | {
|
---|
300 | HRESULT GetSystemFontFallback(IDWriteFontFallback **fallback);
|
---|
301 | HRESULT CreateFontFallbackBuilder(IDWriteFontFallbackBuilder **fallbackbuilder);
|
---|
302 | HRESULT TranslateColorGlyphRun(FLOAT originX,
|
---|
303 | FLOAT originY,
|
---|
304 | const DWRITE_GLYPH_RUN *run,
|
---|
305 | const DWRITE_GLYPH_RUN_DESCRIPTION *rundescr,
|
---|
306 | DWRITE_MEASURING_MODE mode,
|
---|
307 | const DWRITE_MATRIX *transform,
|
---|
308 | UINT32 palette_index,
|
---|
309 | IDWriteColorGlyphRunEnumerator **colorlayers
|
---|
310 | );
|
---|
311 |
|
---|
312 | HRESULT CreateCustomRenderingParams(FLOAT gamma,
|
---|
313 | FLOAT contrast,
|
---|
314 | FLOAT grayscalecontrast,
|
---|
315 | FLOAT cleartypeLevel,
|
---|
316 | DWRITE_PIXEL_GEOMETRY pixelGeometry,
|
---|
317 | DWRITE_RENDERING_MODE renderingMode,
|
---|
318 | DWRITE_GRID_FIT_MODE gridFitMode,
|
---|
319 | IDWriteRenderingParams2 **params
|
---|
320 | );
|
---|
321 |
|
---|
322 | HRESULT CreateGlyphRunAnalysis(const DWRITE_GLYPH_RUN *run,
|
---|
323 | const DWRITE_MATRIX *transform,
|
---|
324 | DWRITE_RENDERING_MODE renderingMode,
|
---|
325 | DWRITE_MEASURING_MODE measuringMode,
|
---|
326 | DWRITE_GRID_FIT_MODE gridFitMode,
|
---|
327 | DWRITE_TEXT_ANTIALIAS_MODE antialiasMode,
|
---|
328 | FLOAT originX,
|
---|
329 | FLOAT originY,
|
---|
330 | IDWriteGlyphRunAnalysis **analysis
|
---|
331 | );
|
---|
332 | }
|
---|