diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-10-09 14:59:43 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-10-09 15:00:59 (GMT) |
commit | 30bd59a1dec78e3b8bb9bbbc4f129663efa169a6 (patch) | |
tree | 967ef1c2b3416477d25b7a256490c271ab5259fc /src/gui/text/qfontdatabase.cpp | |
parent | 45b8fa65b82bcdb82ddb2f515e551d2948baf36d (diff) | |
download | Qt-30bd59a1dec78e3b8bb9bbbc4f129663efa169a6.zip Qt-30bd59a1dec78e3b8bb9bbbc4f129663efa169a6.tar.gz Qt-30bd59a1dec78e3b8bb9bbbc4f129663efa169a6.tar.bz2 |
Fix printing bitmap fonts on X11 with FontConfig enabled
When FontConfig was enabled, bitmap fonts would often get a different
pixel size than the one we requested. Usually the size would only be
a pixel off, but this was especially visible when printing in highres
with bitmap fonts, because in those cases we would request a pixel size
which was computed based on the printer's high dpi.
The result was that all printed text with bitmap fonts would be really
really tiny. The fix falls back to using the XLFD font engine when
using bitmap fonts (when the returned pixel size is different from the
requested), because this engine scales the fonts for us. This will
cause bitmap fonts to be rendered without antialiasing.
Task-number: QTBUG-3620
Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/text/qfontdatabase.cpp')
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 0aed71a..d0f4d2e 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -949,7 +949,7 @@ struct QtFontDesc #if !defined(Q_WS_MAC) static void match(int script, const QFontDef &request, const QString &family_name, const QString &foundry_name, int force_encoding_id, - QtFontDesc *desc, const QList<int> &blacklistedFamilies = QList<int>()); + QtFontDesc *desc, const QList<int> &blacklistedFamilies = QList<int>(), bool forceXLFD=false); #if defined(Q_WS_X11) || defined(Q_WS_QWS) static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef) @@ -1316,7 +1316,7 @@ unsigned int bestFoundry(int script, unsigned int score, int styleStrategy, */ static void match(int script, const QFontDef &request, const QString &family_name, const QString &foundry_name, int force_encoding_id, - QtFontDesc *desc, const QList<int> &blacklistedFamilies) + QtFontDesc *desc, const QList<int> &blacklistedFamilies, bool forceXLFD) { Q_UNUSED(force_encoding_id); @@ -1351,7 +1351,7 @@ static void match(int script, const QFontDef &request, unsigned int score = ~0u; - load(family_name, script); + load(family_name, script, forceXLFD); QFontDatabasePrivate *db = privateDb(); for (int x = 0; x < db->count; ++x) { |