wbemprox: Add support for uncommitted instances in IWbemClassObject::Get.
[wine] / dlls / dwrite / font.c
1 /*
2  *    Font and collections
3  *
4  * Copyright 2012 Nikolay Sivov for CodeWeavers
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #define COBJMACROS
22
23 #include "dwrite.h"
24 #include "dwrite_private.h"
25
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
29
30 struct dwrite_fontfamily {
31     IDWriteFontFamily IDWriteFontFamily_iface;
32     LONG ref;
33
34     WCHAR *familyname;
35 };
36
37 struct dwrite_font {
38     IDWriteFont IDWriteFont_iface;
39     LONG ref;
40
41     IDWriteFontFamily *family;
42     IDWriteFontFace *face;
43     DWRITE_FONT_STYLE style;
44 };
45
46 struct dwrite_fontface {
47     IDWriteFontFace IDWriteFontFace_iface;
48     LONG ref;
49 };
50
51 static inline struct dwrite_fontface *impl_from_IDWriteFontFace(IDWriteFontFace *iface)
52 {
53     return CONTAINING_RECORD(iface, struct dwrite_fontface, IDWriteFontFace_iface);
54 }
55
56 static inline struct dwrite_font *impl_from_IDWriteFont(IDWriteFont *iface)
57 {
58     return CONTAINING_RECORD(iface, struct dwrite_font, IDWriteFont_iface);
59 }
60
61 static inline struct dwrite_fontfamily *impl_from_IDWriteFontFamily(IDWriteFontFamily *iface)
62 {
63     return CONTAINING_RECORD(iface, struct dwrite_fontfamily, IDWriteFontFamily_iface);
64 }
65
66 static HRESULT WINAPI dwritefontface_QueryInterface(IDWriteFontFace *iface, REFIID riid, void **obj)
67 {
68     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
69
70     TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
71
72     if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDWriteFontFace))
73     {
74         *obj = iface;
75         IDWriteFontFace_AddRef(iface);
76         return S_OK;
77     }
78
79     *obj = NULL;
80     return E_NOINTERFACE;
81 }
82
83 static ULONG WINAPI dwritefontface_AddRef(IDWriteFontFace *iface)
84 {
85     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
86     ULONG ref = InterlockedIncrement(&This->ref);
87     TRACE("(%p)->(%d)\n", This, ref);
88     return ref;
89 }
90
91 static ULONG WINAPI dwritefontface_Release(IDWriteFontFace *iface)
92 {
93     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
94     ULONG ref = InterlockedDecrement(&This->ref);
95
96     TRACE("(%p)->(%d)\n", This, ref);
97
98     if (!ref)
99         heap_free(This);
100
101     return S_OK;
102 }
103
104 static DWRITE_FONT_FACE_TYPE WINAPI dwritefontface_GetType(IDWriteFontFace *iface)
105 {
106     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
107     FIXME("(%p): stub\n", This);
108     return DWRITE_FONT_FACE_TYPE_UNKNOWN;
109 }
110
111 static HRESULT WINAPI dwritefontface_GetFiles(IDWriteFontFace *iface, UINT32 *number_of_files,
112     IDWriteFontFile **fontfiles)
113 {
114     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
115     FIXME("(%p)->(%p %p): stub\n", This, number_of_files, fontfiles);
116     return E_NOTIMPL;
117 }
118
119 static UINT32 WINAPI dwritefontface_GetIndex(IDWriteFontFace *iface)
120 {
121     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
122     FIXME("(%p): stub\n", This);
123     return 0;
124 }
125
126 static DWRITE_FONT_SIMULATIONS WINAPI dwritefontface_GetSimulations(IDWriteFontFace *iface)
127 {
128     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
129     FIXME("(%p): stub\n", This);
130     return DWRITE_FONT_SIMULATIONS_NONE;
131 }
132
133 static BOOL WINAPI dwritefontface_IsSymbolFont(IDWriteFontFace *iface)
134 {
135     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
136     FIXME("(%p): stub\n", This);
137     return FALSE;
138 }
139
140 static void WINAPI dwritefontface_GetMetrics(IDWriteFontFace *iface, DWRITE_FONT_METRICS *metrics)
141 {
142     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
143     FIXME("(%p)->(%p): stub\n", This, metrics);
144 }
145
146 static UINT16 WINAPI dwritefontface_GetGlyphCount(IDWriteFontFace *iface)
147 {
148     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
149     FIXME("(%p): stub\n", This);
150     return 0;
151 }
152
153 static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace *iface,
154     UINT16 const *glyph_indices, UINT32 glyph_count, DWRITE_GLYPH_METRICS *metrics, BOOL is_sideways)
155 {
156     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
157     FIXME("(%p)->(%p %u %p %d): stub\n", This, glyph_indices, glyph_count, metrics, is_sideways);
158     return E_NOTIMPL;
159 }
160
161 static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace *iface, UINT32 const *codepoints,
162     UINT32 count, UINT16 *glyph_indices)
163 {
164     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
165     FIXME("(%p)->(%p %u %p): stub\n", This, codepoints, count, glyph_indices);
166     return E_NOTIMPL;
167 }
168
169 static HRESULT WINAPI dwritefontface_TryGetFontTable(IDWriteFontFace *iface, UINT32 table_tag,
170     const void **table_data, UINT32 *table_size, void **context, BOOL *exists)
171 {
172     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
173     FIXME("(%p)->(%u %p %p %p %p): stub\n", This, table_tag, table_data, table_size, context, exists);
174     return E_NOTIMPL;
175 }
176
177 static void WINAPI dwritefontface_ReleaseFontTable(IDWriteFontFace *iface, void *table_context)
178 {
179     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
180     FIXME("(%p)->(%p): stub\n", This, table_context);
181 }
182
183 static HRESULT WINAPI dwritefontface_GetGlyphRunOutline(IDWriteFontFace *iface, FLOAT emSize,
184     UINT16 const *glyph_indices, FLOAT const* glyph_advances, DWRITE_GLYPH_OFFSET const *glyph_offsets,
185     UINT32 glyph_count, BOOL is_sideways, BOOL is_rtl, IDWriteGeometrySink *geometrysink)
186 {
187     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
188     FIXME("(%p)->(%f %p %p %p %u %d %d %p): stub\n", This, emSize, glyph_indices, glyph_advances, glyph_offsets,
189         glyph_count, is_sideways, is_rtl, geometrysink);
190     return E_NOTIMPL;
191 }
192
193 static HRESULT WINAPI dwritefontface_GetRecommendedRenderingMode(IDWriteFontFace *iface, FLOAT emSize,
194     FLOAT pixels_per_dip, DWRITE_MEASURING_MODE mode, IDWriteRenderingParams* params, DWRITE_RENDERING_MODE* rendering_mode)
195 {
196     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
197     FIXME("(%p)->(%f %f %d %p %p): stub\n", This, emSize, pixels_per_dip, mode, params, rendering_mode);
198     return E_NOTIMPL;
199 }
200
201 static HRESULT WINAPI dwritefontface_GetGdiCompatibleMetrics(IDWriteFontFace *iface, FLOAT emSize, FLOAT pixels_per_dip,
202     DWRITE_MATRIX const *transform, DWRITE_FONT_METRICS *metrics)
203 {
204     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
205     FIXME("(%p)->(%f %f %p %p): stub\n", This, emSize, pixels_per_dip, transform, metrics);
206     return E_NOTIMPL;
207 }
208
209 static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFace *iface, FLOAT emSize, FLOAT pixels_per_dip,
210     DWRITE_MATRIX const *transform, BOOL use_gdi_natural, UINT16 const *glyph_indices, UINT32 glyph_count,
211     DWRITE_GLYPH_METRICS *metrics, BOOL is_sideways)
212 {
213     struct dwrite_fontface *This = impl_from_IDWriteFontFace(iface);
214     FIXME("(%p)->(%f %f %p %d %p %u %p %d): stub\n", This, emSize, pixels_per_dip, transform, use_gdi_natural, glyph_indices,
215         glyph_count, metrics, is_sideways);
216     return E_NOTIMPL;
217 }
218
219 static const IDWriteFontFaceVtbl dwritefontfacevtbl = {
220     dwritefontface_QueryInterface,
221     dwritefontface_AddRef,
222     dwritefontface_Release,
223     dwritefontface_GetType,
224     dwritefontface_GetFiles,
225     dwritefontface_GetIndex,
226     dwritefontface_GetSimulations,
227     dwritefontface_IsSymbolFont,
228     dwritefontface_GetMetrics,
229     dwritefontface_GetGlyphCount,
230     dwritefontface_GetDesignGlyphMetrics,
231     dwritefontface_GetGlyphIndices,
232     dwritefontface_TryGetFontTable,
233     dwritefontface_ReleaseFontTable,
234     dwritefontface_GetGlyphRunOutline,
235     dwritefontface_GetRecommendedRenderingMode,
236     dwritefontface_GetGdiCompatibleMetrics,
237     dwritefontface_GetGdiCompatibleGlyphMetrics
238 };
239
240 static HRESULT create_fontface(IDWriteFontFace **face)
241 {
242     struct dwrite_fontface *This;
243
244     *face = NULL;
245
246     This = heap_alloc(sizeof(struct dwrite_fontface));
247     if (!This) return E_OUTOFMEMORY;
248
249     This->IDWriteFontFace_iface.lpVtbl = &dwritefontfacevtbl;
250     This->ref = 1;
251     *face = &This->IDWriteFontFace_iface;
252
253     return S_OK;
254 }
255
256 static HRESULT WINAPI dwritefont_QueryInterface(IDWriteFont *iface, REFIID riid, void **obj)
257 {
258     struct dwrite_font *This = impl_from_IDWriteFont(iface);
259
260     TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
261
262     if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDWriteFont))
263     {
264         *obj = iface;
265         IDWriteFont_AddRef(iface);
266         return S_OK;
267     }
268
269     *obj = NULL;
270     return E_NOINTERFACE;
271 }
272
273 static ULONG WINAPI dwritefont_AddRef(IDWriteFont *iface)
274 {
275     struct dwrite_font *This = impl_from_IDWriteFont(iface);
276     ULONG ref = InterlockedIncrement(&This->ref);
277     TRACE("(%p)->(%d)\n", This, ref);
278     return ref;
279 }
280
281 static ULONG WINAPI dwritefont_Release(IDWriteFont *iface)
282 {
283     struct dwrite_font *This = impl_from_IDWriteFont(iface);
284     ULONG ref = InterlockedDecrement(&This->ref);
285
286     TRACE("(%p)->(%d)\n", This, ref);
287
288     if (!ref)
289     {
290         IDWriteFontFamily_Release(This->family);
291         heap_free(This);
292     }
293
294     return S_OK;
295 }
296
297 static HRESULT WINAPI dwritefont_GetFontFamily(IDWriteFont *iface, IDWriteFontFamily **family)
298 {
299     struct dwrite_font *This = impl_from_IDWriteFont(iface);
300     TRACE("(%p)->(%p)\n", This, family);
301
302     *family = This->family;
303     IDWriteFontFamily_AddRef(*family);
304     return S_OK;
305 }
306
307 static DWRITE_FONT_WEIGHT WINAPI dwritefont_GetWeight(IDWriteFont *iface)
308 {
309     struct dwrite_font *This = impl_from_IDWriteFont(iface);
310     FIXME("(%p): stub\n", This);
311     return 0;
312 }
313
314 static DWRITE_FONT_STRETCH WINAPI dwritefont_GetStretch(IDWriteFont *iface)
315 {
316     struct dwrite_font *This = impl_from_IDWriteFont(iface);
317     FIXME("(%p): stub\n", This);
318     return DWRITE_FONT_STRETCH_UNDEFINED;
319 }
320
321 static DWRITE_FONT_STYLE WINAPI dwritefont_GetStyle(IDWriteFont *iface)
322 {
323     struct dwrite_font *This = impl_from_IDWriteFont(iface);
324     TRACE("(%p)\n", This);
325     return This->style;
326 }
327
328 static BOOL WINAPI dwritefont_IsSymbolFont(IDWriteFont *iface)
329 {
330     struct dwrite_font *This = impl_from_IDWriteFont(iface);
331     FIXME("(%p): stub\n", This);
332     return FALSE;
333 }
334
335 static HRESULT WINAPI dwritefont_GetFaceNames(IDWriteFont *iface, IDWriteLocalizedStrings **names)
336 {
337     struct dwrite_font *This = impl_from_IDWriteFont(iface);
338     FIXME("(%p)->(%p): stub\n", This, names);
339     return E_NOTIMPL;
340 }
341
342 static HRESULT WINAPI dwritefont_GetInformationalStrings(IDWriteFont *iface,
343     DWRITE_INFORMATIONAL_STRING_ID stringid, IDWriteLocalizedStrings **strings, BOOL *exists)
344 {
345     struct dwrite_font *This = impl_from_IDWriteFont(iface);
346     FIXME("(%p)->(%d %p %p): stub\n", This, stringid, strings, exists);
347     return E_NOTIMPL;
348 }
349
350 static DWRITE_FONT_SIMULATIONS WINAPI dwritefont_GetSimulations(IDWriteFont *iface)
351 {
352     struct dwrite_font *This = impl_from_IDWriteFont(iface);
353     FIXME("(%p): stub\n", This);
354     return DWRITE_FONT_SIMULATIONS_NONE;
355 }
356
357 static void WINAPI dwritefont_GetMetrics(IDWriteFont *iface, DWRITE_FONT_METRICS *metrics)
358 {
359     struct dwrite_font *This = impl_from_IDWriteFont(iface);
360     FIXME("(%p)->(%p): stub\n", This, metrics);
361 }
362
363 static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont *iface, UINT32 value, BOOL *exists)
364 {
365     struct dwrite_font *This = impl_from_IDWriteFont(iface);
366     FIXME("(%p)->(0x%08x %p): stub\n", This, value, exists);
367     return E_NOTIMPL;
368 }
369
370 static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont *iface, IDWriteFontFace **face)
371 {
372     struct dwrite_font *This = impl_from_IDWriteFont(iface);
373
374     TRACE("(%p)->(%p)\n", This, face);
375
376     if (!This->face)
377     {
378         HRESULT hr = create_fontface(&This->face);
379         if (FAILED(hr)) return hr;
380         *face = This->face;
381         return hr;
382     }
383
384     *face = This->face;
385     IDWriteFontFace_AddRef(*face);
386
387     return S_OK;
388 }
389
390 static const IDWriteFontVtbl dwritefontvtbl = {
391     dwritefont_QueryInterface,
392     dwritefont_AddRef,
393     dwritefont_Release,
394     dwritefont_GetFontFamily,
395     dwritefont_GetWeight,
396     dwritefont_GetStretch,
397     dwritefont_GetStyle,
398     dwritefont_IsSymbolFont,
399     dwritefont_GetFaceNames,
400     dwritefont_GetInformationalStrings,
401     dwritefont_GetSimulations,
402     dwritefont_GetMetrics,
403     dwritefont_HasCharacter,
404     dwritefont_CreateFontFace
405 };
406
407
408 static HRESULT WINAPI dwritefontfamily_QueryInterface(IDWriteFontFamily *iface, REFIID riid, void **obj)
409 {
410     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
411     TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
412
413     if (IsEqualIID(riid, &IID_IUnknown) ||
414         IsEqualIID(riid, &IID_IDWriteFontList) ||
415         IsEqualIID(riid, &IID_IDWriteFontFamily))
416     {
417         *obj = iface;
418         IDWriteFontFamily_AddRef(iface);
419         return S_OK;
420     }
421
422     *obj = NULL;
423     return E_NOINTERFACE;
424 }
425
426 static ULONG WINAPI dwritefontfamily_AddRef(IDWriteFontFamily *iface)
427 {
428     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
429     ULONG ref = InterlockedIncrement(&This->ref);
430     TRACE("(%p)->(%d)\n", This, ref);
431     return ref;
432 }
433
434 static ULONG WINAPI dwritefontfamily_Release(IDWriteFontFamily *iface)
435 {
436     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
437     ULONG ref = InterlockedDecrement(&This->ref);
438
439     TRACE("(%p)->(%d)\n", This, ref);
440
441     if (!ref)
442     {
443         heap_free(This->familyname);
444         heap_free(This);
445     }
446
447     return S_OK;
448 }
449
450 static HRESULT WINAPI dwritefontfamily_GetFontCollection(IDWriteFontFamily *iface, IDWriteFontCollection **collection)
451 {
452     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
453     FIXME("(%p)->(%p): stub\n", This, collection);
454     return E_NOTIMPL;
455 }
456
457 static UINT32 WINAPI dwritefontfamily_GetFontCount(IDWriteFontFamily *iface)
458 {
459     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
460     FIXME("(%p): stub\n", This);
461     return 0;
462 }
463
464 static HRESULT WINAPI dwritefontfamily_GetFont(IDWriteFontFamily *iface, UINT32 index, IDWriteFont **font)
465 {
466     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
467     FIXME("(%p)->(%u %p): stub\n", This, index, font);
468     return E_NOTIMPL;
469 }
470
471 static HRESULT WINAPI dwritefontfamily_GetFamilyNames(IDWriteFontFamily *iface, IDWriteLocalizedStrings **names)
472 {
473     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
474     static const WCHAR enusW[] = {'e','n','-','u','s',0};
475     HRESULT hr;
476
477     TRACE("(%p)->(%p)\n", This, names);
478
479     hr = create_localizedstrings(names);
480     if (FAILED(hr)) return hr;
481
482     return add_localizedstring(*names, enusW, This->familyname);
483 }
484
485 static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight,
486     DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFont **font)
487 {
488     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
489     FIXME("(%p)->(%d %d %d %p): stub\n", This, weight, stretch, style, font);
490     return E_NOTIMPL;
491 }
492
493 static HRESULT WINAPI dwritefontfamily_GetMatchingFonts(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight,
494     DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontList **fonts)
495 {
496     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
497     FIXME("(%p)->(%d %d %d %p): stub\n", This, weight, stretch, style, fonts);
498     return E_NOTIMPL;
499 }
500
501 static const IDWriteFontFamilyVtbl fontfamilyvtbl = {
502     dwritefontfamily_QueryInterface,
503     dwritefontfamily_AddRef,
504     dwritefontfamily_Release,
505     dwritefontfamily_GetFontCollection,
506     dwritefontfamily_GetFontCount,
507     dwritefontfamily_GetFont,
508     dwritefontfamily_GetFamilyNames,
509     dwritefontfamily_GetFirstMatchingFont,
510     dwritefontfamily_GetMatchingFonts
511 };
512
513 static HRESULT create_fontfamily(const WCHAR *familyname, IDWriteFontFamily **family)
514 {
515     struct dwrite_fontfamily *This;
516
517     *family = NULL;
518
519     This = heap_alloc(sizeof(struct dwrite_fontfamily));
520     if (!This) return E_OUTOFMEMORY;
521
522     This->IDWriteFontFamily_iface.lpVtbl = &fontfamilyvtbl;
523     This->ref = 1;
524     This->familyname = heap_strdupW(familyname);
525
526     *family = &This->IDWriteFontFamily_iface;
527
528     return S_OK;
529 }
530
531 HRESULT create_font_from_logfont(const LOGFONTW *logfont, IDWriteFont **font)
532 {
533     const WCHAR* facename, *familyname;
534     struct dwrite_font *This;
535     IDWriteFontFamily *family;
536     OUTLINETEXTMETRICW *otm;
537     HRESULT hr;
538     HFONT hfont;
539     HDC hdc;
540     int ret;
541
542     *font = NULL;
543
544     hfont = CreateFontIndirectW(logfont);
545     if (!hfont) return DWRITE_E_NOFONT;
546
547     hdc = CreateCompatibleDC(0);
548     SelectObject(hdc, hfont);
549
550     ret = GetOutlineTextMetricsW(hdc, 0, NULL);
551     otm = heap_alloc(ret);
552     otm->otmSize = ret;
553     ret = GetOutlineTextMetricsW(hdc, otm->otmSize, otm);
554
555     DeleteDC(hdc);
556     DeleteObject(hfont);
557
558     facename = (WCHAR*)((char*)otm + (ptrdiff_t)otm->otmpFaceName);
559     familyname = (WCHAR*)((char*)otm + (ptrdiff_t)otm->otmpFamilyName);
560     TRACE("facename=%s, familyname=%s\n", debugstr_w(facename), debugstr_w(familyname));
561
562     hr = create_fontfamily(familyname, &family);
563     heap_free(otm);
564     if (hr != S_OK) return hr;
565
566     This = heap_alloc(sizeof(struct dwrite_font));
567     if (!This)
568     {
569         IDWriteFontFamily_Release(family);
570         return E_OUTOFMEMORY;
571     }
572
573     This->IDWriteFont_iface.lpVtbl = &dwritefontvtbl;
574     This->ref = 1;
575     This->face = NULL;
576     This->family = family;
577     This->style = logfont->lfItalic ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL;
578
579     *font = &This->IDWriteFont_iface;
580
581     return S_OK;
582 }