André Hentschel : gdi32: Don't strip font suffix.

Alexandre Julliard julliard at winehq.org
Tue Nov 17 09:28:20 CST 2009


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Mon Nov 16 21:33:43 2009 +0100

gdi32: Don't strip font suffix.

---

 dlls/gdi32/font.c       |   22 ----------------------
 dlls/gdi32/tests/font.c |    6 ------
 2 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index ed64166..7f8f6f6 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -306,10 +306,6 @@ HFONT WINAPI CreateFontIndirectA( const LOGFONTA *plfA )
  */
 HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
 {
-    static const WCHAR ItalicW[] = {' ','I','t','a','l','i','c','\0'};
-    static const WCHAR BoldW[]   = {' ','B','o','l','d','\0'};
-    WCHAR *pFaceNameItalicSuffix, *pFaceNameBoldSuffix;
-    WCHAR *pFaceNameSuffix = NULL;
     HFONT hFont;
     FONTOBJ *fontPtr;
 
@@ -328,24 +324,6 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
              plf->lfOrientation/10., plf->lfEscapement/10., fontPtr);
     }
 
-    pFaceNameItalicSuffix = strstrW(fontPtr->logfont.lfFaceName, ItalicW);
-    if (pFaceNameItalicSuffix)
-    {
-        fontPtr->logfont.lfItalic = TRUE;
-        pFaceNameSuffix = pFaceNameItalicSuffix;
-    }
-
-    pFaceNameBoldSuffix = strstrW(fontPtr->logfont.lfFaceName, BoldW);
-    if (pFaceNameBoldSuffix)
-    {
-        if (fontPtr->logfont.lfWeight < FW_BOLD)
-            fontPtr->logfont.lfWeight = FW_BOLD;
-        if (!pFaceNameSuffix || (pFaceNameBoldSuffix < pFaceNameSuffix))
-            pFaceNameSuffix = pFaceNameBoldSuffix;
-    }
-
-    if (pFaceNameSuffix) *pFaceNameSuffix = 0;
-
     if (!(hFont = alloc_gdi_handle( &fontPtr->header, OBJ_FONT, &font_funcs )))
     {
         HeapFree( GetProcessHeap(), 0, fontPtr );
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 6d76abe..4ad418f 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -3013,15 +3013,12 @@ void test_CreateFontIndirect(void)
     ok(hfont != 0, "CreateFontIndirectA failed\n");
     ret = GetObject(hfont, sizeof(getobj_lf), &getobj_lf);
     ok(lf.lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf.lfItalic, getobj_lf.lfItalic);
-    todo_wine
-    {
     ok(lf.lfWeight == getobj_lf.lfWeight ||
        broken((SHORT)lf.lfWeight == getobj_lf.lfWeight), /* win9x */
        "lfWeight: expect %08x got %08x\n", lf.lfWeight, getobj_lf.lfWeight);
     ok(!lstrcmpA(lf.lfFaceName, getobj_lf.lfFaceName) ||
        broken(!memcmp(lf.lfFaceName, getobj_lf.lfFaceName, LF_FACESIZE-1)), /* win9x doesn't ensure '\0' termination */
        "font names don't match: %s != %s\n", lf.lfFaceName, getobj_lf.lfFaceName);
-    }
     DeleteObject(hfont);
 
     lf.lfItalic = FALSE;
@@ -3033,13 +3030,10 @@ void test_CreateFontIndirect(void)
     ok(lf.lfWeight == getobj_lf.lfWeight ||
        broken((SHORT)lf.lfWeight == getobj_lf.lfWeight), /* win9x */
        "lfWeight: expect %08x got %08x\n", lf.lfWeight, getobj_lf.lfWeight);
-    todo_wine
-    {
     ok(lf.lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf.lfItalic, getobj_lf.lfItalic);
     ok(!lstrcmpA(lf.lfFaceName, getobj_lf.lfFaceName) ||
        broken(!memcmp(lf.lfFaceName, getobj_lf.lfFaceName, LF_FACESIZE-1)), /* win9x doesn't ensure '\0' termination */
        "font names don't match: %s != %s\n", lf.lfFaceName, getobj_lf.lfFaceName);
-    }
     DeleteObject(hfont);
 }
 




More information about the wine-cvs mailing list