Nikolay Sivov : dwrite: Added basic GetFirstMatchingFont() for font family.

Alexandre Julliard julliard at winehq.org
Tue Oct 23 13:37:18 CDT 2012


Module: wine
Branch: master
Commit: 22508806fc8c2abef7816c4f5c06dc0917a6e5f3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=22508806fc8c2abef7816c4f5c06dc0917a6e5f3

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Oct 23 08:18:32 2012 -0400

dwrite: Added basic GetFirstMatchingFont() for font family.

---

 dlls/dwrite/font.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index bdc84ee..4b697e9 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -607,8 +607,16 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *i
     DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFont **font)
 {
     struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface);
-    FIXME("(%p)->(%d %d %d %p): stub\n", This, weight, stretch, style, font);
-    return E_NOTIMPL;
+    LOGFONTW lf;
+
+    TRACE("(%p)->(%d %d %d %p)\n", This, weight, stretch, style, font);
+
+    memset(&lf, 0, sizeof(lf));
+    lf.lfWeight = weight;
+    lf.lfItalic = style == DWRITE_FONT_STYLE_ITALIC;
+    strcpyW(lf.lfFaceName, This->familyname);
+
+    return create_font_from_logfont(&lf, font);
 }
 
 static HRESULT WINAPI dwritefontfamily_GetMatchingFonts(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight,




More information about the wine-cvs mailing list