PATCH: MS Sans Serif: font creation vs font enumeration

Marcus Meissner marcus at jet.franken.de
Thu Oct 27 07:08:25 CDT 2005


Hi,

We allow to create a MS Sans Serif font ... But we do not find it
when asked to enumerate it.

The problem is the remapping voodoo within our font handling.

The following workaround works ... But well, is slightly hacky.

Can be reproduced with uiview32.exe from
http://bugs.winehq.org/show_bug.cgi?id=3671

Ciao, Marcus

Changelog:
	Map MS Sans Serif to defSans font when we do
	not find it in our loaded list.

Index: freetype.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/freetype.c,v
retrieving revision 1.105
diff -u -r1.105 freetype.c
--- dlls/gdi/freetype.c	6 Oct 2005 12:28:11 -0000	1.105
+++ dlls/gdi/freetype.c	27 Oct 2005 12:04:56 -0000
@@ -2566,6 +2566,7 @@
             plf = &lf;
         }
 
+repeat:
         LIST_FOR_EACH(family_elem_ptr, &font_list) {
             family = LIST_ENTRY(family_elem_ptr, Family, entry);
             if(!strcmpiW(plf->lfFaceName, family->FamilyName)) {
@@ -2607,6 +2608,16 @@
 		}
 	    }
 	}
+	/* We allow to open "MS Sans Serif", but it will not get
+	 * enumerated here. This confuses a VB App for instance.
+	 */
+	if (!strcmpW(plf->lfFaceName,MSSansSerifW)) {
+            memcpy(&lf, plf, sizeof(lf));
+            strcpyW(lf.lfFaceName, defSans);
+            plf = &lf;
+	    goto repeat;
+	}
+
     } else {
         LIST_FOR_EACH(family_elem_ptr, &font_list) {
             family = LIST_ENTRY(family_elem_ptr, Family, entry);



More information about the wine-patches mailing list