Take monospace fonts into account in default font selection algorithm.

Mike Hearn mike at navi.cx
Sat Aug 7 06:52:09 CDT 2004


Mike Hearn <mike at navi.cx>
Take monospace fonts into account in default font selection algorithm.

--- dlls/gdi/freetype.c.~1.63~	2004-08-03 21:02:17.000000000 +0100
+++ dlls/gdi/freetype.c	2004-08-03 21:12:22.819008296 +0100
@@ -167,7 +167,7 @@
     BOOL Bold;
     FONTSIGNATURE fs;
     FT_Fixed font_version;
-    BOOL scalable;
+    BOOL scalable, fixed_width;
     Bitmap_Size size;     /* set if face is a bitmap */
     BOOL external; /* TRUE if we should manually add this font to the registry */
     struct tagFace *next;
@@ -510,6 +510,8 @@
                 (*insertface)->scalable = FALSE;
             }
 
+            (*insertface)->fixed_width = ft_face->face_flags & FT_FACE_FLAG_FIXED_WIDTH;
+
             memset(&(*insertface)->fs, 0, sizeof((*insertface)->fs));
 
             pOS2 = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_os2);
@@ -1614,10 +1616,12 @@
 	}
     }
 
+    /* match on charset and style */
     if(!family) {
         for(family = FontList; family; family = family->next) {
             
-	    if(csi.fs.fsCsb[0] & family->FirstFace->fs.fsCsb[0])
+	    if((csi.fs.fsCsb[0] & family->FirstFace->fs.fsCsb[0]) &&
+               (family->FirstFace->fixed_width == (lf.lfPitchAndFamily & MONO_FONT)))
                 if(family->FirstFace->scalable || can_use_bitmap)
                     break;
 	}





More information about the wine-patches mailing list