Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > by-pkgid > cb5cb393fb2cff46997de4bce8173fc9 > files > 14

qt3-3.3.4-23.2.20060mdk.src.rpm

applied: yes
author: TT

See http://dot.kde.org/1078392985/1078396152/1078420128/

Index: src/kernel/qfontdatabase_x11.cpp
===================================================================
RCS file: /home/kde/qt-copy/src/kernel/qfontdatabase_x11.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -p -b -r1.31 -r1.32
--- src/kernel/qfontdatabase_x11.cpp	2 Mar 2004 12:50:32 -0000	1.31
+++ src/kernel/qfontdatabase_x11.cpp	4 Mar 2004 17:51:41 -0000	1.32
@@ -1508,6 +1508,24 @@ QFontEngine *loadEngine( QFont::Script s
 	XftResult res;
 	XftPattern *result =
 	    XftFontMatch( QPaintDevice::x11AppDisplay(), fp->screen, pattern, &res );
+#ifdef QT_XFT2
+	if (script == QFont::Latin) {
+	    // since we added the Euro char on top, check we actually got the family
+	    // we requested. If we didn't get it correctly, remove the Euro from the pattern
+	    // and try again.
+	    FcChar8 *f;
+	    res = FcPatternGetString(result, FC_FAMILY, 0, &f);
+	    if (res == FcResultMatch && QString::fromUtf8((char *)f) != family->rawName) {
+		qDebug("trying without Euro");
+		FcPatternDel(pattern, FC_CHARSET);
+		FcCharSet *cs = FcCharSetCreate();
+		QChar sample = sampleCharacter(script);
+		FcCharSetAddChar(cs, sample.unicode());
+		FcPatternAddCharSet(pattern, FC_CHARSET, cs);
+		result = XftFontMatch( QPaintDevice::x11AppDisplay(), fp->screen, pattern, &res );
+	    }
+	}
+#endif
 	XftPatternDestroy(pattern);
 
 	// We pass a duplicate to XftFontOpenPattern because either xft font