[4/5] dwrite: Added basic GetFirstMatchingFont() for font family

Nikolay Sivov nsivov at codeweavers.com
Tue Oct 23 06:28:33 CDT 2012


Added basic GetFirstMatchingFont() for font family
-------------- next part --------------
>From daf9b56d0294655443f2947bfb10922e3adce66c Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue, 23 Oct 2012 08:18:32 -0400
Subject: [PATCH 4/7] Added basic GetFirstMatchingFont() for font family

---
 dlls/dwrite/font.c |   12 ++++++++++--
 1 file 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,
-- 
1.7.10.4




More information about the wine-patches mailing list