summaryrefslogtreecommitdiff
path: root/vcl/skia/win/gdiimpl.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-04-15 13:08:02 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-04-15 15:11:04 +0200
commit2ddfa9918352a082990ba189d094bae838f82190 (patch)
treeb1f4a44f29e4b737914644492a6818b9bdd8aac4 /vcl/skia/win/gdiimpl.cxx
parentc3b044abc2906bbb56a0f359f89ee7c1eb400c93 (diff)
fix Skia glyph orientation with DirectWrite (tdf#132084)
LOGFONT includes info about whether a glyph should be rotated, so we don't need to do it explicitly, but with DirectWrite apparently this information doesn't carry over. Change-Id: I4530511c4de7b64a6488629b380be34d4a42b3d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92260 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/skia/win/gdiimpl.cxx')
-rw-r--r--vcl/skia/win/gdiimpl.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index fd796794464e..2de81c7d8f16 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -172,8 +172,12 @@ bool WinSkiaSalGraphicsImpl::DrawTextLayout(const GenericSalLayout& rLayout)
return false;
}
sk_sp<SkTypeface> typeface = createDirectWriteTypeface(logFont);
+ GlyphOrientation glyphOrientation = GlyphOrientation::Apply;
if (!typeface) // fall back to GDI text rendering
+ {
typeface.reset(SkCreateTypefaceFromLOGFONT(logFont));
+ glyphOrientation = GlyphOrientation::Ignore;
+ }
// lfHeight actually depends on DPI, so it's not really font height as such,
// but for LOGFONT-based typefaces Skia simply sets lfHeight back to this value
// directly.
@@ -187,7 +191,7 @@ bool WinSkiaSalGraphicsImpl::DrawTextLayout(const GenericSalLayout& rLayout)
COLORREF color = ::GetTextColor(mWinParent.getHDC());
Color salColor(GetRValue(color), GetGValue(color), GetBValue(color));
// The font already is set up to have glyphs rotated as needed.
- impl->drawGenericLayout(rLayout, salColor, font, SkiaSalGraphicsImpl::GlyphOrientation::Ignore);
+ impl->drawGenericLayout(rLayout, salColor, font, glyphOrientation);
return true;
}