From 9f63e2dc0e57fc35683f1aec915f699647987408 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 16 Dec 2014 14:51:21 +0100 Subject: 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 Reviewed-by: Konstantin Ritt --- src/plugins/platforms/windows/qwindowsfontengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowsfontengine.cpp') 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; -- cgit v1.2.3