Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > cc8f970be8f3f9d917634bf75d52343e > files > 49

qt3-3.3.4-23mdk.src.rpm

--- qt-x11-free-3.1.0/src/kernel/qfontdatabase_x11.cpp.orig	2002-11-17 18:36:32.000000000 +0100
+++ qt-x11-free-3.1.0/src/kernel/qfontdatabase_x11.cpp	2002-11-17 20:11:41.000000000 +0100
@@ -127,6 +127,7 @@
     if ( db ) return;
     db = new QFontDatabasePrivate;
 
+    if (!qt_has_xft) {
     int fontCount;
     // force the X server to give us XLFDs
     char **fontList = XListFonts( QPaintDevice::x11AppDisplay(),
@@ -231,6 +232,7 @@
     }
 
     XFreeFontNames( fontList );
+    }
 
 #ifndef QT_NO_XFTFREETYPE
 
@@ -375,6 +377,51 @@
 	}
 
 	XftFontSetDestroy (foundries);
+
+// add default alias fonts
+#ifdef QT_XFT2
+       const char * const alias_font[] = { "sans", "serif", "monospace", 0 };
+       const char * const alias_style[] = { "Normal", "Bold", "Italic", "Bold Italic", 0 };
+
+       QtFontFoundry *foundry = new QtFontFoundry("alias");
+       Q_CHECK_PTR(foundry);
+       db->addFoundry(foundry);
+
+       QtFontFamily *family;
+       QtFontStyle *style;
+       int f=0, s=0;
+
+       while (alias_font[f] != 0) {
+            family = new QtFontFamily ( foundry, alias_font[f]);
+                   Q_CHECK_PTR (family);
+            foundry->addFamily (family);
+           while (alias_style[s] != 0) {
+               style = new QtFontStyle (family, alias_style[s]);
+
+               switch(s) {
+                   case 0:
+                     break;
+                   case 1:
+                     style->weightString = getXftWeightString(XFT_WEIGHT_BOLD);
+                     break;
+                   case 2:
+                     style->ital = 1;
+                     break;
+                   case 3:
+                     style->ital = 1;
+                     style->weightString = getXftWeightString(XFT_WEIGHT_BOLD);
+               }
+
+               style->lesserItal = FALSE;
+               style->setSmoothlyScalable();
+               family->addStyle (style);
+               s++;
+           }
+
+           f++; s=0;
+       }
+#endif
+							
     }
 #endif