diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-01 19:31:41 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-02 17:13:30 +0200 |
commit | f29d94c7b1bf9bee3e3598d90ba6e9dfd684ecfc (patch) | |
tree | 94572cb3fa8561533907b0f7621d01d713280d40 /vcl/inc/win | |
parent | 5d87f7f3477728767790eafa11d52b95623dd7c5 (diff) |
tdf#162259: correctly handle font width on Windows
Unlike other platforms, on Windows, the font width is not relative to
font height, but to average width of font's glyphs. This is mentioned
in LogicalFontInstance::GetScale.
1. In VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D,
when calculating the correction for width / height (introduced in
commit cc3663bbaed4f65d64154e5f9abb51a5f622f710, 2024-04-20), the
already applied X scale is now calculated using unscaled font's width.
2. Commit 8557ea84c9336ba8061246f1f46ddb6e02f413a1 (Exclude getHScale
from DirectWrite font rendering, 2024-04-08) was effectively reverted,
because I was wrong assuming that the code there was unnecessary.
3. Commit 2092df2a9044f1c2ae4379f48a3201e5867575a8 (tdf#161154: pass
"scaling is done externally" information down the stack, 2024-05-18)
was also reverted.
Change-Id: I8cff39b67a6efd380f7807f5655f401bdb62cc3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171382
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl/inc/win')
-rw-r--r-- | vcl/inc/win/winlayout.hxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 31066a7db28a..cfb36e825b54 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -36,6 +36,8 @@ class WinFontInstance : public LogicalFontInstance public: ~WinFontInstance() override; + float getHScale() const; + void SetGraphics(WinSalGraphics*); WinSalGraphics* GetGraphics() const { return m_pGraphics; } |