[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/skia
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 20 15:17:04 UTC 2021
vcl/skia/win/gdiimpl.cxx | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit f373aa69b2c3fb2b4679448074a4d2d313c96d34
Author: Luboš Luňák <l.lunak at centrum.cz>
AuthorDate: Tue Apr 20 09:48:25 2021 +0000
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Tue Apr 20 17:16:30 2021 +0200
fix too wide glyphs with Skia/GDI if horizontal scale is used (tdf#141715)
Change-Id: I7b06b64e04313493f48b7224fbc4883356feda95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114327
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
(cherry picked from commit 764360df78535befcc4806736fcbaedbe0e34ea1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114284
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index b609581e1e84..d35cf91232ac 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -213,6 +213,12 @@ bool WinSkiaSalGraphicsImpl::DrawTextLayout(const GenericSalLayout& rLayout)
GlyphOrientation glyphOrientation = GlyphOrientation::Apply;
if (!typeface) // fall back to GDI text rendering
{
+ // If lfWidth is kept, then with fHScale != 1 characters get too wide, presumably
+ // because the horizontal scaling gets applied twice if GDI is used for drawing (tdf#141715).
+ // Using lfWidth /= fHScale gives slightly incorrect sizes, for a reason I don't understand.
+ // LOGFONT docs say that 0 means GDI will find out the right value on its own somehow,
+ // and it apparently works.
+ logFont.lfWidth = 0;
typeface.reset(SkCreateTypefaceFromLOGFONT(logFont));
glyphOrientation = GlyphOrientation::Ignore;
}
More information about the Libreoffice-commits
mailing list