diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2014-12-16 14:51:21 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2014-12-18 09:43:13 +0100 |
commit | 9f63e2dc0e57fc35683f1aec915f699647987408 (patch) | |
tree | fcc2b958e7905de66d159e45abb2063bfac7fb5d /src | |
parent | bfbb985ed5d283114dbe37e6a42a3c19a61cd0d2 (diff) |
Fix PDF when embedding fonts with large internal leading
Setting lfHeight to a positive value in LOGFONT requests the font
with the given cell height, which is em square size + internal
leading. When setting this to the em square size, it means we
will get glyphs that are actually sized for an em square with
sides that are (emSquareSize - internalLeading). For most fonts,
this was not noticeable, but for some fonts with large internal
leading, the resulting glyphs would be very small.
When setting lfHeight to something < 0 instead, we are selecting
the font with the given character height instead, which is not
including the internal leading.
[ChangeLog][PDF] Fix embedding glyphs from fonts with large
internal leading.
Task-number: QTBUG-43082
Change-Id: Id74cf2279df2062804e9431fe305d803cb0b19d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontengine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 38856a69de..e45ff5d744 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1017,7 +1017,7 @@ QFontEngine::Properties QWindowsFontEngine::properties() const void QWindowsFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) { LOGFONT lf = m_logfont; - lf.lfHeight = unitsPerEm; + lf.lfHeight = -unitsPerEm; int flags = synthesized(); if(flags & SynthesizedItalic) lf.lfItalic = false; |