summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-08-21 15:05:19 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-21 16:39:55 +0200
commitbd9a023a41209a216eec28bd25a20372a5172b6a (patch)
treefba5e367f9614672e469223f787f97713a74fc63 /src/gui
parentecbd3a70e4cd7322dd4fe07c4e46d06afa3e952b (diff)
Don't use qt_mac_get_fixed_pitch() to resolve fixed pitch fonts on OSX
The call was resulting in inifinite recursion on OSX 10.9 when Qt was built against the 10.7 SDK, as qt_mac_get_fixed_pitch uses QFontMetrics to resolve the pitch, and we would end up in the font resolver again when asking for the metrics. The CoreText font-database already takes care of resolving whether or not a font family is fixed-pitch, so the code is likely a leftover from the ATSUI-days, and can be removed. Task-number: QTBUG-31803 Change-Id: I37c90fa637927eb4adc16c0fd556c4c46c456034 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qfontdatabase.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 62379cd592..54b4629ca0 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -314,9 +314,6 @@ struct QtFontFamily
QtFontFamily(const QString &n)
:
fixedPitch(false),
-#if !defined(QWS) && defined(Q_OS_MAC)
- fixedPitchComputed(false),
-#endif
name(n), count(0), foundries(0)
, bogusWritingSystems(false)
, askedForFallback(false)
@@ -330,9 +327,6 @@ struct QtFontFamily
}
bool fixedPitch : 1;
-#if !defined(QWS) && defined(Q_OS_MAC)
- bool fixedPitchComputed : 1;
-#endif
QString name;
QStringList aliases;
@@ -348,18 +342,6 @@ struct QtFontFamily
QtFontFoundry *foundry(const QString &f, bool = false);
};
-#if !defined(QWS) && defined(Q_OS_MAC)
-inline static void qt_mac_get_fixed_pitch(QtFontFamily *f)
-{
- if(f && !f->fixedPitchComputed) {
- QFontMetrics fm(f->name);
- f->fixedPitch = fm.width(QLatin1Char('i')) == fm.width(QLatin1Char('m'));
- f->fixedPitchComputed = true;
- }
-}
-#endif
-
-
QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create)
{
if (f.isNull() && count == 1)
@@ -823,9 +805,6 @@ unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
EncodingMismatch = 0x0002
};
if (pitch != '*') {
-#if !defined(QWS) && defined(Q_OS_MAC)
- qt_mac_get_fixed_pitch(const_cast<QtFontFamily*>(family));
-#endif
if ((pitch == 'm' && !family->fixedPitch)
|| (pitch == 'p' && family->fixedPitch))
this_score += PitchMismatch;
@@ -1263,9 +1242,6 @@ bool QFontDatabase::isFixedPitch(const QString &family,
QT_PREPEND_NAMESPACE(load)(familyName);
QtFontFamily *f = d->family(familyName);
-#if !defined(QWS) && defined(Q_OS_MAC)
- qt_mac_get_fixed_pitch(f);
-#endif
return (f && f->fixedPitch);
}