diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2015-05-01 08:21:29 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-07-31 09:50:17 +0000 |
commit | c57c89b3c1b2b61c838b98458f6dbfad297dc7e3 (patch) | |
tree | 22b02214cc36104f7b7888e65161f3241182d177 /src | |
parent | 073f4f9bb21817d76d55324a74899d2f40118042 (diff) |
Don't expose qt_setQtEnableTestFont(bool) by default
Build it only in -developer-build mode for tests that might depend
on exact-matching font behavior.
Return earlier to avoid doing any useless job.
Change-Id: I966ee5689f03403e45f4c957b63e3113f0467803
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 40e61f42ec..85a804acfe 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -72,12 +72,14 @@ QT_BEGIN_NAMESPACE #define SMOOTH_SCALABLE 0xffff +#if defined(QT_BUILD_INTERNAL) bool qt_enable_test_font = false; Q_AUTOTEST_EXPORT void qt_setQtEnableTestFont(bool value) { qt_enable_test_font = value; } +#endif static int getFontWeight(const QString &weightString) { @@ -2561,6 +2563,15 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script) QFontEngine *engine; +#if defined(QT_BUILD_INTERNAL) + // For testing purpose only, emulates an exact-matching monospace font + if (qt_enable_test_font && request.family == QLatin1String("__Qt__Box__Engine__")) { + engine = new QTestFontEngine(request.pixelSize); + engine->fontDef = request; + return engine; + } +#endif + // Until we specifically asked not to, try looking for Multi font engine // first, the last '1' indicates that we want Multi font engine instead // of single ones @@ -2576,12 +2587,6 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script) parseFontName(request.family, foundry_name, family_name); - if (qt_enable_test_font && request.family == QLatin1String("__Qt__Box__Engine__")) { - engine =new QTestFontEngine(request.pixelSize); - engine->fontDef = request; - return engine; - } - QtFontDesc desc; QList<int> blackListed; int index = match(script, request, family_name, foundry_name, &desc, blackListed); |