Stop-ship 0.9 problem

Mike Hearn mike at plan99.net
Sat Oct 1 17:53:09 CDT 2005


There is a serious problem with Wine 0.9 as-is, namely that we now respect
Windows antialiasing settings. 

If you have a patented bytecode hinter enabled FreeType, things look OK:

  http://plan99.net/~mike/files/hinted-fonts.jpg

but if you don't (like 99% of Linux users):

  http://www.republika.pl/belegdol/temp/wine.png

Needless to say we can't ship 0.9 when it'll look like that for most users.

The attached patch fixes the issue by providing an
override for antialiasing. FreeType AA makes the fonts look good again
at small sizes.

It also changes the logic on one line - I may be mistaken but it looked wrong 
to my eye:

-        if(!get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY)
+        if(get_gasp_flags(physDev, &flags) && (flags & GASP_DOGRAY))

We can patch this variable in Crossover (where CW ship a licensed freetype
copy) so the correct AA settings are used which (a) looks nicer and (b)
makes font metrics correct.

A better long term solution suggested by Krzysztof Foltman might be to
make bitmapped copies of a hinted Tahoma at small sizes, for instance.

thanks -mike




Index: dlls/x11drv/xrender.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/xrender.c,v
retrieving revision 1.74
diff -u -p -d -r1.74 xrender.c
--- dlls/x11drv/xrender.c	23 Sep 2005 10:05:54 -0000	1.74
+++ dlls/x11drv/xrender.c	1 Oct 2005 22:48:10 -0000
@@ -100,6 +100,12 @@ static INT mru = -1;
 
 static int antialias = 1;
 
+/* we need this for WineHQ because antialiasing is necessary to cover
+ * up for deficiencies in the FreeType auto-hinter (a pox upon Apple
+ * for not releasing the patent royalty free. It expires sometime
+ * around 2009) */
+static BOOL force_always_antialias = TRUE;
+
 /* some default values just in case */
 #ifndef SONAME_LIBX11
 #define SONAME_LIBX11 "libX11.so"
@@ -442,7 +448,7 @@ static BOOL get_gasp_flags(X11DRV_PDEVIC
     GetTextMetricsW(physDev->hdc, &tm);
     ppem = abs(X11DRV_YWStoDS(physDev, tm.tmAscent + tm.tmDescent - tm.tmInternalLeading));
 
-    gasp++;
+    gasp++;                     /* skip version field */
     num_recs = get_be_word(*gasp);
     gasp++;
     while(num_recs--)
@@ -474,15 +480,25 @@ static int GetCacheEntry(X11DRV_PDEVICE 
         assert( !entry->format[format] );
     }
 
-    if(antialias && plfsz->lf.lfQuality != NONANTIALIASED_QUALITY)
+    if (force_always_antialias)
     {
-        if(!get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY)
-            entry->aa_default = AA_Grey;
+        entry->aa_default = AA_Grey;
+    }
+    else
+    {
+        if ((antialias && plfsz->lf.lfQuality != NONANTIALIASED_QUALITY))
+        {
+            if(get_gasp_flags(physDev, &flags) && (flags & GASP_DOGRAY))
+                entry->aa_default = AA_Grey;
+            else
+                entry->aa_default = AA_None;
+        }
         else
+        {
             entry->aa_default = AA_None;
+        }
     }
-    else
-        entry->aa_default = AA_None;
+
 
     return ret;
 }





More information about the wine-devel mailing list