summaryrefslogtreecommitdiff
path: root/vcl/inc/win
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-04-24 17:07:30 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-24 18:40:15 +0200
commit51bcbfc88883596fceedfe019e841aab129425c9 (patch)
treea3e92f946038764e5a329abc737ab2aea437b98a /vcl/inc/win
parent27c6d1dbdb3dcad02a244ab942adb9222a461e44 (diff)
Related: tdf#113076 vcl win DirectWrite: handle stretched text
Commit a51b7a1c3a7e7cf7b0c733e1dec40288278c1884 (tdf#103831, tdf#100986: Force using GDI when needed, 2017-03-03) noted that the DirectWrite text renderer doesn't support stretched text, add support for this now by setting a DirectWrite transform matrix that only does horizontal scaling. With this, tdf#113076 is kept fixed, but at the same time manually stretched text keeps working. Previously the glyphs of the text had the correct size and position, but the glyphs themselves where not streched, but simply aligned to the left. Change-Id: I8fe8e74d3edc0d71ed2f16fcce66c6f5009ed264 Reviewed-on: https://gerrit.libreoffice.org/71245 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/inc/win')
-rw-r--r--vcl/inc/win/DWriteTextRenderer.hxx12
-rw-r--r--vcl/inc/win/winlayout.hxx1
2 files changed, 13 insertions, 0 deletions
diff --git a/vcl/inc/win/DWriteTextRenderer.hxx b/vcl/inc/win/DWriteTextRenderer.hxx
index 92e0825bb8b3..a84cf81b9b66 100644
--- a/vcl/inc/win/DWriteTextRenderer.hxx
+++ b/vcl/inc/win/DWriteTextRenderer.hxx
@@ -81,6 +81,18 @@ private:
D2DTextAntiAliasMode meTextAntiAliasMode;
};
+/// Sets and unsets the needed DirectWrite transform to support the font's horizontal scaling.
+class WinFontStretchGuard
+{
+public:
+ WinFontStretchGuard(ID2D1RenderTarget* pRenderTarget, float fHScale);
+ ~WinFontStretchGuard();
+
+private:
+ ID2D1RenderTarget* mpRenderTarget;
+ D2D1::Matrix3x2F maTransform;
+};
+
#endif // INCLUDED_VCL_INC_WIN_DWRITERENDERER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx
index 279c155b0a97..257c92e1a672 100644
--- a/vcl/inc/win/winlayout.hxx
+++ b/vcl/inc/win/winlayout.hxx
@@ -151,6 +151,7 @@ public:
~WinFontInstance() override;
bool hasHScale() const;
+ float getHScale() const;
void SetGraphics(WinSalGraphics*);
WinSalGraphics* GetGraphics() const { return m_pGraphics; }