Merge lp:~ken-vandine/kubuntu-packaging/qt into lp:~kubuntu-packagers/kubuntu-packaging/qt

Proposed by Ken VanDine
Status: Merged
Merge reported by: Jonathan Riddell
Merged at revision: not available
Proposed branch: lp:~ken-vandine/kubuntu-packaging/qt
Merge into: lp:~kubuntu-packagers/kubuntu-packaging/qt
Diff against target: 144 lines (+115/-2)
3 files modified
debian/changelog (+7/-2)
debian/patches/fix_medium_font.diff (+105/-0)
debian/patches/series (+3/-0)
To merge this branch: bzr merge lp:~ken-vandine/kubuntu-packaging/qt
Reviewer Review Type Date Requested Status
Kubuntu Packagers Pending
Review via email: mp+126542@code.launchpad.net

Description of the change

default to Regular font in X11

Default to Regular/Normal instead of Medium in QFontDatabase for X11.

Tweak the buckets so that Medium has preference over Bold when DemiBold
is requested.

To post a comment you must log in.
Revision history for this message
Jonathan Riddell (jr) wrote :

merged long since

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-09-24 12:41:03 +0000
3+++ debian/changelog 2012-09-26 20:33:22 +0000
4@@ -1,9 +1,14 @@
5-qt4-x11 (4:4.8.3+dfsg-0ubuntu2) UNRELEASED; urgency=low
6+qt4-x11 (4:4.8.3+dfsg-0ubuntu2) quantal-proposed; urgency=low
7
8+ [ Felix Geyer ]
9 * Drop versioned build-dependcy on g++-4.6 [armel]. g++ 4.7 is used
10 on all architectures in Ubuntu.
11
12- -- Felix Geyer <debfx@ubuntu.com> Mon, 24 Sep 2012 14:39:23 +0200
13+ [ Ken VanDine ]
14+ * debian/patches/fix_medium_font.diff
15+ - Patch from Michał Sawicz to fix Ubuntu Medium font in Qt (LP: #744812)
16+
17+ -- Ken VanDine <ken.vandine@canonical.com> Wed, 26 Sep 2012 16:25:16 -0400
18
19 qt4-x11 (4:4.8.3+dfsg-0ubuntu1) quantal; urgency=low
20
21
22=== added file 'debian/patches/fix_medium_font.diff'
23--- debian/patches/fix_medium_font.diff 1970-01-01 00:00:00 +0000
24+++ debian/patches/fix_medium_font.diff 2012-09-26 20:33:22 +0000
25@@ -0,0 +1,105 @@
26+From: Ken VanDine <ken.vandine@canonical.com>
27+Description: Default to regular font in X11
28+ Default to Regular/Normal instead of Medium in QFontDatabase for X11.
29+ .
30+ Tweak the buckets so that Medium has preference over Bold when DemiBold
31+ is requested.
32+Bug-Ubuntu: https://launchpad.net/bugs/744812
33+Bug: https://bugreports.qt-project.org/browse/QTBUG-27301
34+Forwarded: https://codereview.qt-project.org/#change,35591
35+Author: Michał Sawicz<michal.sawicz@canonical.com>
36+
37+--- a/src/gui/text/qfontdatabase_x11.cpp
38++++ b/src/gui/text/qfontdatabase_x11.cpp
39+@@ -729,10 +729,17 @@
40+ static int getFCWeight(int fc_weight)
41+ {
42+ int qtweight = QFont::Black;
43+- if (fc_weight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_MEDIUM) / 2)
44++ if (fc_weight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_REGULAR) / 2)
45+ qtweight = QFont::Light;
46+- else if (fc_weight <= (FC_WEIGHT_MEDIUM + FC_WEIGHT_DEMIBOLD) / 2)
47++ else if (fc_weight <= (FC_WEIGHT_REGULAR + FC_WEIGHT_MEDIUM) / 2)
48+ qtweight = QFont::Normal;
49++#if 0
50++ // FIXME: Uncomment this when it's safe to expand the Enum to include ::Medium
51++ // Will map Medium to DemiBold via fallthrough for the moment,
52++ // but avoids API/ABI break
53++ else if (fc_weight <= (FC_WEIGHT_MEDIUM + FC_WEIGHT_DEMIBOLD) / 2)
54++ qtweight = QFont::Medium;
55++#endif
56+ else if (fc_weight <= (FC_WEIGHT_DEMIBOLD + FC_WEIGHT_BOLD) / 2)
57+ qtweight = QFont::DemiBold;
58+ else if (fc_weight <= (FC_WEIGHT_BOLD + FC_WEIGHT_BLACK) / 2)
59+@@ -772,9 +779,13 @@
60+ fontDef.styleHint
61+ */
62+
63++ // Default to Regular and thus to the common case. Previous
64++ // versions of Qt requested Medium as default. This is fine until
65++ // a Medium weight is actually provided by a font, and so gets
66++ // promoted to bold fallthrough.
67+ int weight;
68+ if (FcPatternGetInteger(pattern, FC_WEIGHT, 0, &weight) != FcResultMatch)
69+- weight = FC_WEIGHT_MEDIUM;
70++ weight = FC_WEIGHT_REGULAR;
71+ fontDef.weight = getFCWeight(weight);
72+
73+ int slant;
74+@@ -1066,16 +1077,19 @@
75+ // capitalize(value);
76+ familyName = QString::fromUtf8((const char *)value);
77+ slant_value = FC_SLANT_ROMAN;
78+- weight_value = FC_WEIGHT_MEDIUM;
79++ weight_value = FC_WEIGHT_REGULAR;
80+ spacing_value = FC_PROPORTIONAL;
81+ file_value = 0;
82+ index_value = 0;
83+ scalable = FcTrue;
84+
85++ // Fallthroughs in case a match was not found. In previous
86++ // versions of Qt, Medium was requested from FontConfig,
87++ // leading to a promotion from Medium to Bold.
88+ if (FcPatternGetInteger (fonts->fonts[i], FC_SLANT, 0, &slant_value) != FcResultMatch)
89+ slant_value = FC_SLANT_ROMAN;
90+ if (FcPatternGetInteger (fonts->fonts[i], FC_WEIGHT, 0, &weight_value) != FcResultMatch)
91+- weight_value = FC_WEIGHT_MEDIUM;
92++ weight_value = FC_WEIGHT_REGULAR;
93+ if (FcPatternGetInteger (fonts->fonts[i], FC_SPACING, 0, &spacing_value) != FcResultMatch)
94+ spacing_value = FC_PROPORTIONAL;
95+ if (FcPatternGetString (fonts->fonts[i], FC_FILE, 0, &file_value) != FcResultMatch)
96+@@ -1487,14 +1501,32 @@
97+ }
98+
99+ int weight_value = FC_WEIGHT_BLACK;
100++ // Default and request Regular font weight if none specified
101++ // Previous versions of Qt default to requesting Medium, even
102++ // though this weight does not typically exist.
103+ if (request.weight == 0)
104+- weight_value = FC_WEIGHT_MEDIUM;
105++ weight_value = FC_WEIGHT_REGULAR;
106+ else if (request.weight < (QFont::Light + QFont::Normal) / 2)
107+ weight_value = FC_WEIGHT_LIGHT;
108+- else if (request.weight < (QFont::Normal + QFont::DemiBold) / 2)
109++#if 0
110++ // FIXME: Avoid ABI Break; active this full codepath when
111++ // QFont::Medium enum is available in the future
112++ else if (request.weight < (QFont::Normal + QFont::Medium) / 2)
113++ weight_value = FC_WEIGHT_REGULAR;
114++ else if (request.weight < (QFont::Medium + QFont::DemiBold) / 2)
115+ weight_value = FC_WEIGHT_MEDIUM;
116+ else if (request.weight < (QFont::DemiBold + QFont::Bold) / 2)
117+ weight_value = FC_WEIGHT_DEMIBOLD;
118++#else
119++ // For the moment This may still not full-circle correctly; via
120++ // Medium->DemiBold->Bold promotion. However It's hard to do much
121++ // about this without an ABI/API tweak to include the fuller set
122++ // of standard TTF/CSS/FontConfig weights.
123++ else if (request.weight < (QFont::Normal + QFont::DemiBold) / 2)
124++ weight_value = FC_WEIGHT_REGULAR;
125++ else if (request.weight < (QFont::DemiBold + QFont::Bold) / 2)
126++ weight_value = (FC_WEIGHT_MEDIUM + FC_WEIGHT_DEMIBOLD) / 2;
127++#endif
128+ else if (request.weight < (QFont::Bold + QFont::Black) / 2)
129+ weight_value = FC_WEIGHT_BOLD;
130+ FcPatternDel(pattern, FC_WEIGHT);
131
132=== modified file 'debian/patches/series'
133--- debian/patches/series 2012-09-19 14:12:33 +0000
134+++ debian/patches/series 2012-09-26 20:33:22 +0000
135@@ -45,6 +45,9 @@
136 CVE-2011-3922.patch
137 no_libicu_message.diff
138 QTBUG-25324_assistant_segfault_on_start_with_gcc_4.7.patch
139+
140+# ubuntu patches
141+fix_medium_font.diff
142
143 # kubuntu patches
144 kubuntu_10_ibus_input_method.diff

Subscribers

People subscribed via source and target branches