summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vcl/skia/win/gdiimpl.cxx6
1 files changed, 6 insertions, 0 deletions
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;
}