Module: wine Branch: master Commit: ef173c4312524a04bc53240b19fe907cef3ec4c7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ef173c4312524a04bc53240b19...
Author: Aric Stewart aric@codeweavers.com Date: Wed Sep 3 07:27:17 2014 -0500
dwrite: Implement GetFontCollection.
---
dlls/dwrite/font.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 546dab8..395fb64 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -167,6 +167,8 @@ struct dwrite_fontfamily { UINT32 font_count; UINT32 alloc;
+ IDWriteFontCollection* collection; + WCHAR *familyname; };
@@ -836,6 +838,8 @@ static ULONG WINAPI dwritefontfamily_Release(IDWriteFontFamily *iface) int i; heap_free(This->familyname);
+ if (This->collection) + IDWriteFontCollection_Release(This->collection); for (i = 0; i < This->font_count; i++) _free_font_data(This->fonts[i]); heap_free(This->fonts); @@ -848,8 +852,15 @@ static ULONG WINAPI dwritefontfamily_Release(IDWriteFontFamily *iface) static HRESULT WINAPI dwritefontfamily_GetFontCollection(IDWriteFontFamily *iface, IDWriteFontCollection **collection) { struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); - FIXME("(%p)->(%p): stub\n", This, collection); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, collection); + if (This->collection) + { + IDWriteFontCollection_AddRef(This->collection); + *collection = This->collection; + return S_OK; + } + else + return E_NOTIMPL; }
static UINT32 WINAPI dwritefontfamily_GetFontCount(IDWriteFontFamily *iface) @@ -1130,6 +1141,7 @@ static HRESULT create_fontfamily(const WCHAR *familyname, IDWriteFontFamily **fa This->font_count = 0; This->alloc = 2; This->fonts = heap_alloc(sizeof(*This->fonts) * 2); + This->collection = NULL; This->familyname = heap_strdupW(familyname);
*family = &This->IDWriteFontFamily_iface;