Windows: Default to vertical hinting when high-dpi scaling is enabled
Since hinted text layouts are not scalable, we should disable
hinting by default when the high-dpi scaling is active.
This is the Windows version of 0f7bc885aa
,
which solved the same issue for the fontconfig database.
Change-Id: I48b5da5b045dec195fd257743175017f39cf9620
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
This commit is contained in:
parent
115f303352
commit
6a6c14626d
@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
#include <QtGui/QFont>
|
#include <QtGui/QFont>
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
|
#include <QtGui/private/qhighdpiscaling_p.h>
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
#include <QtCore/qmath.h>
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
@ -1100,8 +1101,11 @@ QFontEngine *QWindowsFontDatabase::fontEngine(const QByteArray &fontData, qreal
|
|||||||
QFontEngine *fontEngine = 0;
|
QFontEngine *fontEngine = 0;
|
||||||
|
|
||||||
#if !defined(QT_NO_DIRECTWRITE)
|
#if !defined(QT_NO_DIRECTWRITE)
|
||||||
if (hintingPreference == QFont::PreferDefaultHinting
|
bool useDirectWrite = (hintingPreference == QFont::PreferNoHinting)
|
||||||
|| hintingPreference == QFont::PreferFullHinting)
|
|| (hintingPreference == QFont::PreferVerticalHinting)
|
||||||
|
|| (QHighDpiScaling::isActive() && hintingPreference == QFont::PreferDefaultHinting);
|
||||||
|
|
||||||
|
if (!useDirectWrite)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
GUID guid;
|
GUID guid;
|
||||||
@ -1704,7 +1708,8 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
|
|||||||
|
|
||||||
#if !defined(QT_NO_DIRECTWRITE)
|
#if !defined(QT_NO_DIRECTWRITE)
|
||||||
bool useDirectWrite = (request.hintingPreference == QFont::PreferNoHinting)
|
bool useDirectWrite = (request.hintingPreference == QFont::PreferNoHinting)
|
||||||
|| (request.hintingPreference == QFont::PreferVerticalHinting);
|
|| (request.hintingPreference == QFont::PreferVerticalHinting)
|
||||||
|
|| (QHighDpiScaling::isActive() && request.hintingPreference == QFont::PreferDefaultHinting);
|
||||||
if (useDirectWrite && initDirectWrite(data.data())) {
|
if (useDirectWrite && initDirectWrite(data.data())) {
|
||||||
const QString fam = QString::fromWCharArray(lf.lfFaceName);
|
const QString fam = QString::fromWCharArray(lf.lfFaceName);
|
||||||
const QString nameSubstitute = QWindowsFontEngineDirectWrite::fontNameSubstitute(fam);
|
const QString nameSubstitute = QWindowsFontEngineDirectWrite::fontNameSubstitute(fam);
|
||||||
|
Loading…
Reference in New Issue
Block a user