summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-04-30 17:38:14 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-30 21:56:11 +0200
commitf7453b956bcf83ec13c805d243f20cb209289179 (patch)
tree2a57dc59cc90c3e995d5a68447dd46d85e0c4aea /vcl/inc
parent4aeb48d4691f8852b7afd908637d1a85ae434c84 (diff)
tdf#114209 vcl win DirectWrite: handle rotated text
Commit a51b7a1c3a7e7cf7b0c733e1dec40288278c1884 (tdf#103831, tdf#100986: Force using GDI when needed, 2017-03-03) noted that the DirectWrite text renderer doesn't support vertical text, add initial support for this now by extending the DirectWrite transform matrix to do rotation as well. This is initial support, as it can be improved in two ways: - vertical text is not cached - only vertical Latin text is handled, which wants rotated glyphs (vs e.g. Japanese text that would not rotate the glyphs) With this, the "unreadable" text in the bugdoc's chart is on par with the the GDI rendering. Change-Id: I07af4de6cb437f83cc40546396ec8c8aac456bb3 Reviewed-on: https://gerrit.libreoffice.org/71592 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/win/DWriteTextRenderer.hxx11
-rw-r--r--vcl/inc/win/winlayout.hxx2
2 files changed, 8 insertions, 5 deletions
diff --git a/vcl/inc/win/DWriteTextRenderer.hxx b/vcl/inc/win/DWriteTextRenderer.hxx
index a84cf81b9b66..9011a951d277 100644
--- a/vcl/inc/win/DWriteTextRenderer.hxx
+++ b/vcl/inc/win/DWriteTextRenderer.hxx
@@ -81,12 +81,15 @@ private:
D2DTextAntiAliasMode meTextAntiAliasMode;
};
-/// Sets and unsets the needed DirectWrite transform to support the font's horizontal scaling.
-class WinFontStretchGuard
+/**
+ * Sets and unsets the needed DirectWrite transform to support the font's horizontal scaling and
+ * rotation.
+ */
+class WinFontTransformGuard
{
public:
- WinFontStretchGuard(ID2D1RenderTarget* pRenderTarget, float fHScale);
- ~WinFontStretchGuard();
+ WinFontTransformGuard(ID2D1RenderTarget* pRenderTarget, float fHScale, const GenericSalLayout& rLayout, const D2D1_POINT_2F& rBaseline);
+ ~WinFontTransformGuard();
private:
ID2D1RenderTarget* mpRenderTarget;
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx
index 257c92e1a672..991c68f15b66 100644
--- a/vcl/inc/win/winlayout.hxx
+++ b/vcl/inc/win/winlayout.hxx
@@ -165,7 +165,7 @@ public:
const WinFontFace * GetFontFace() const { return static_cast<const WinFontFace *>(LogicalFontInstance::GetFontFace()); }
- bool CacheGlyphToAtlas(HDC hDC, HFONT hFont, int nGlyphIndex, SalGraphics& rGraphics);
+ bool CacheGlyphToAtlas(HDC hDC, HFONT hFont, int nGlyphIndex, SalGraphics& rGraphics, const GenericSalLayout& rLayout);
OpenGLGlyphCache& GetOpenGLGlyphCache() { return maOpenGLGlyphCache; }
bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const override;