rev 5189 - in trunk/packages/qt-x11-free/debian: . patches

Modestas Vainius modax-guest at alioth.debian.org
Thu Dec 28 22:21:26 CET 2006


Author: modax-guest
Date: 2006-12-28 22:21:25 +0100 (Thu, 28 Dec 2006)
New Revision: 5189

Added:
   trunk/packages/qt-x11-free/debian/patches/61_fcfontmatch_fontwidth_fix.dpatch
Modified:
   trunk/packages/qt-x11-free/debian/changelog
   trunk/packages/qt-x11-free/debian/patches/00list
Log:
Make QT select "normal" (book), not condensed variant of Dejavu fonts when default "Sans Serif", "Serif" or "Monospace" font is requested. Problem is described at http://lists.debian.org/debian-kde/2006/12/msg00042.html


Modified: trunk/packages/qt-x11-free/debian/changelog
===================================================================
--- trunk/packages/qt-x11-free/debian/changelog	2006-12-28 12:09:11 UTC (rev 5188)
+++ trunk/packages/qt-x11-free/debian/changelog	2006-12-28 21:21:25 UTC (rev 5189)
@@ -1,12 +1,21 @@
-qt-x11-free (3:3.3.7-2) unstable; urgency=low
+qt-x11-free (3:3.3.7-2) unstable; urgency=medium
 
   +++ Changes by Sune Vuorela:
 
   * Remove extra 's' in package description of qt3-designer. (Closes: #398883)
   * Add gdb to qt3-x11-free-dbg - you can't create backtraces without
 
- -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Fri, 17 Nov 2006 23:42:45 +0100
+  +++ Changes by Modestas Vainius:
 
+  * debian/patches/61_fcfontmatch_fontwidth_fix.dpatch
+      Fix font matching with fontconfig. This resolves inconsistency with
+      determining font width (e.g. Dejavu Sans "Condensed" may get selected
+      instead of "Book" for Sans Serif font) for default fonts (Sans Serif,
+      Serif and Monospace). This bug is very important because it makes
+      default KDE fonts look ugly in most cases.
+
+ -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Thu, 28 Dec 2006 22:37:21 +0200
+
 qt-x11-free (3:3.3.7-1) unstable; urgency=medium
 
   * New upstream release. Includes the fix to CVE-2006-4811, an integer

Modified: trunk/packages/qt-x11-free/debian/patches/00list
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/00list	2006-12-28 12:09:11 UTC (rev 5188)
+++ trunk/packages/qt-x11-free/debian/patches/00list	2006-12-28 21:21:25 UTC (rev 5189)
@@ -38,3 +38,4 @@
 48_immodule_xim_fix
 49_immodule_inputcontext_fix
 60_gnu_hurd_support
+61_fcfontmatch_fontwidth_fix

Added: trunk/packages/qt-x11-free/debian/patches/61_fcfontmatch_fontwidth_fix.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/61_fcfontmatch_fontwidth_fix.dpatch	2006-12-28 12:09:11 UTC (rev 5188)
+++ trunk/packages/qt-x11-free/debian/patches/61_fcfontmatch_fontwidth_fix.dpatch	2006-12-28 21:21:25 UTC (rev 5189)
@@ -0,0 +1,75 @@
+#! /bin/sh -e
+## 61_fcfontmatch-fix.dpatch by Modestas Vainius <geromanas at mailas.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Follow fontconfig API. Fix matching for some font families
+## DP: (e.g. for "Sans" Dejavu Sans "Condensed" variant was
+## DP: selected while the rest of the system (GTK2) selected "Book"
+## DP: variant)
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt-x11-free-3.3.7/src/kernel/qfontdatabase_x11.cpp	2006-12-28 21:40:34.000000000 +0200
++++ qt-x11-free-3.3.7/src/kernel/qfontdatabase_x11.cpp	2006-12-28 21:43:44.000000000 +0200
+@@ -1,4 +1,4 @@
+-/****************************************************************************
++/***************************
+ ** $Id: qt/qfontdatabase_x11.cpp   3.3.7   edited Feb 13 2006 $
+ **
+ ** Implementation of platform specific QFontDatabase
+@@ -1504,13 +1504,24 @@
+       convert the pixel size to a point size and request that.
+     */
+     double size_value = request.pixelSize;
++    double dpi = QPaintDevice::x11AppDpiY(fp->screen);
+     double scale = 1.;
+     if ( size_value > MAXFONTSIZE_XFT ) {
+ 	scale = (double)size_value/(double)MAXFONTSIZE_XFT;
+ 	size_value = MAXFONTSIZE_XFT;
+     }
+-
+-    size_value = size_value*72./QPaintDevice::x11AppDpiY(fp->screen);
++#ifdef QT_XFT2
++    /*
++     2006-12-28 If QT is not compiled against xft1, there is no need
++     for the workaround above (confirmed). Thus, in addition, add
++     font pixelsize to the pattern to avoid fontconfig making wrong
++     guesses. Also provide a DPI value for fontconfig so it never
++     attempts to fallback to its default.
++    */
++    XftPatternAddDouble(pattern, XFT_PIXEL_SIZE, size_value);
++    XftPatternAddDouble(pattern, XFT_DPI, dpi);
++#endif
++    size_value = size_value*72./dpi;
+     XftPatternAddDouble( pattern, XFT_SIZE, size_value );
+ 
+ #ifdef XFT_MATRIX
+@@ -1875,6 +1886,11 @@
+     FcResult result;
+         FcFontSet *fs = 0;
+         FcPattern *fsp = 0;
++
++	// Properly conform to fontconfig API. We need to call FcDefaultSubstitute()
++	// before FcFontSort()/FcFontMatch().
++	FcDefaultSubstitute(pattern);
++
+         if( use_fontsort ) {
+             fs = FcFontSort(0, pattern, FcFalse, 0, &result);
+     if (!fs)




More information about the pkg-kde-commits mailing list