summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-07-10 10:17:22 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-10 14:23:46 +0200
commite316519c0e0e1c77aa1039d58776631800f29149 (patch)
tree1f7e885e0925e1fdfc00220ada1eac3242f97edd /src/plugins
parentc15e80f6acf3783d8c4ed4852ad1d1708d34c996 (diff)
Get font's underline position in DirectWrite font engine
Fetch the correct underline position for the font along with other metrics. Task-number: QTBUG-22656 Change-Id: I35f6ea15ad18088033a5e7b7b83e2430c1b32a8f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp9
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
index 3490ebfc80..48aae703a4 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
@@ -242,9 +242,18 @@ void QWindowsFontEngineDirectWrite::collectMetrics()
m_descent = DESIGN_TO_LOGICAL(metrics.descent);
m_xHeight = DESIGN_TO_LOGICAL(metrics.xHeight);
m_lineGap = DESIGN_TO_LOGICAL(metrics.lineGap);
+ m_underlinePosition = DESIGN_TO_LOGICAL(metrics.underlinePosition);
}
}
+QFixed QWindowsFontEngineDirectWrite::underlinePosition() const
+{
+ if (m_underlinePosition > 0)
+ return m_underlinePosition;
+ else
+ return QFontEngine::underlinePosition();
+}
+
QFixed QWindowsFontEngineDirectWrite::lineThickness() const
{
if (m_lineThickness > 0)
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
index 32444c7cb0..195748a886 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
@@ -69,6 +69,7 @@ public:
void initFontInfo(const QFontDef &request, int dpi, IDWriteFont *font);
QFixed lineThickness() const;
+ QFixed underlinePosition() const;
bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
QFixed emSquareSize() const;
@@ -115,6 +116,7 @@ private:
IDWriteBitmapRenderTarget *m_directWriteBitmapRenderTarget;
QFixed m_lineThickness;
+ QFixed m_underlinePosition;
int m_unitsPerEm;
QFixed m_ascent;
QFixed m_descent;