summaryrefslogtreecommitdiff
path: root/vcl/source/outdev/text.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-08-23 04:13:28 +0200
committerخالد حسني <khaled@aliftype.com>2022-08-23 09:24:52 +0200
commitb9f0caad5d9e628f82d5148dfc7d2436d32817e2 (patch)
treeef0e4bcc15040a72d8527d18b53cf5fa00b61f7b /vcl/source/outdev/text.cxx
parente3d120e2ba991897bf7d8eff6cc4eba00f7d749e (diff)
tdf#66819: Disable ligatures with character spacing
When character spacing is not zero, optional ligatures should be disabled (e.g. this what CSS requires and what browsers implement: https://drafts.csswg.org/css-text/#letter-spacing-property). This disables both “liga” and “clig” OpenType features because they are optional features and are enabled by default, it does not disable “rlig” because it is for orthographically-required ligatures, nor “dlig” or “hlig” because they are disabled by default. The character spacing values (confusingly called kerning in the source code) are moved from SvxFont to vcl::Font so it can’t be accessed in OutputDevice and pass the relevant flag to SalLayout. Change-Id: Ieacc875df3896ad7a63ae8d116f4c6ff7265b9a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138711 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/source/outdev/text.cxx')
-rw-r--r--vcl/source/outdev/text.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index d2c8855a2543..823362c6c071 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1177,6 +1177,9 @@ vcl::text::ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
nLayoutFlags |= SalLayoutFlags::KerningAsian;
if( maFont.IsVertical() )
nLayoutFlags |= SalLayoutFlags::Vertical;
+ if( maFont.IsFixKerning() ||
+ ( mpFontInstance && mpFontInstance->GetFontSelectPattern().GetPitch() == PITCH_FIXED ) )
+ nLayoutFlags |= SalLayoutFlags::DisableLigatures;
if( meTextLanguage ) //TODO: (mnTextLayoutMode & vcl::text::ComplexTextLayoutFlags::SubstituteDigits)
{