summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-02-22 14:40:40 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-03-14 08:25:42 (GMT)
commitc0fed43b04dec8bd549043d3ea5e28908128082c (patch)
tree53b111aa672e80585c32e5874646a2c93b186a76 /src/gui/text/qfont_p.h
parent6f5553b95c4df489e0bf047399a90e9a564314e6 (diff)
downloadQt-c0fed43b04dec8bd549043d3ea5e28908128082c.zip
Qt-c0fed43b04dec8bd549043d3ea5e28908128082c.tar.gz
Qt-c0fed43b04dec8bd549043d3ea5e28908128082c.tar.bz2
Introduce QFontEngineDirectWrite
Make a font engine for subpixel positioned text on Windows Vista (with platform update) and Windows 7. If selected during configuration, the engine will be selected only when the hinting preference of a font is set to None or Vertical hinting. The font database uses most of the same logic but creates a direct write font based on the LOGFONT rather than a GDI handle. The engine is currently regarded as experimental, meaning that code using it should do substantial testing to make sure it covers their use cases. Task-number: QTBUG-12678 Reviewed-by: Jiang Jiang
Diffstat (limited to 'src/gui/text/qfont_p.h')
-rw-r--r--src/gui/text/qfont_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 0a3f76d..b23f96e 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -72,7 +72,7 @@ struct QFontDef
: pointSize(-1.0), pixelSize(-1),
styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle),
weight(50), fixedPitch(false), style(QFont::StyleNormal), stretch(100),
- ignorePitch(true)
+ ignorePitch(true), hintingPreference(QFont::PreferDefaultHinting)
#ifdef Q_WS_MAC
,fixedPitchComputed(false)
#endif
@@ -98,7 +98,8 @@ struct QFontDef
uint ignorePitch : 1;
uint fixedPitchComputed : 1; // for Mac OS X only
- int reserved : 16; // for future extensions
+ uint hintingPreference : 2;
+ int reserved : 14; // for future extensions
bool exactMatch(const QFontDef &other) const;
bool operator==(const QFontDef &other) const
@@ -111,6 +112,7 @@ struct QFontDef
&& styleStrategy == other.styleStrategy
&& ignorePitch == other.ignorePitch && fixedPitch == other.fixedPitch
&& family == other.family
+ && hintingPreference == other.hintingPreference
#ifdef Q_WS_X11
&& addStyle == other.addStyle
#endif
@@ -125,6 +127,7 @@ struct QFontDef
if (styleHint != other.styleHint) return styleHint < other.styleHint;
if (styleStrategy != other.styleStrategy) return styleStrategy < other.styleStrategy;
if (family != other.family) return family < other.family;
+ if (hintingPreference != other.hintingPreference) return hintingPreference < other.hintingPreference;
#ifdef Q_WS_X11
if (addStyle != other.addStyle) return addStyle < other.addStyle;