diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-08-23 04:13:28 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-08-23 09:24:52 +0200 |
commit | b9f0caad5d9e628f82d5148dfc7d2436d32817e2 (patch) | |
tree | ef0e4bcc15040a72d8527d18b53cf5fa00b61f7b /include | |
parent | e3d120e2ba991897bf7d8eff6cc4eba00f7d749e (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 'include')
-rw-r--r-- | include/editeng/svxfont.hxx | 6 | ||||
-rw-r--r-- | include/vcl/font.hxx | 3 | ||||
-rw-r--r-- | include/vcl/rendercontext/SalLayoutFlags.hxx | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/include/editeng/svxfont.hxx b/include/editeng/svxfont.hxx index ac4ec390128a..f4810ba25640 100644 --- a/include/editeng/svxfont.hxx +++ b/include/editeng/svxfont.hxx @@ -41,7 +41,6 @@ class EDITENG_DLLPUBLIC SvxFont : public vcl::Font SvxCaseMap eCaseMap; // Text Markup short nEsc; // Degree of Superscript/Subscript sal_uInt8 nPropr; // Degree of reduction of the font height - short nKern; // Kerning in Pt public: SvxFont(); @@ -59,17 +58,12 @@ public: void SetProprRel( const sal_uInt8 nNewPropr ) { SetPropr( static_cast<sal_uInt8>( static_cast<tools::Long>(nNewPropr) * static_cast<tools::Long>(nPropr) / 100 ) ); } - // Kerning - short GetFixKerning() const { return nKern; } - void SetFixKerning( const short nNewKern ) { nKern = nNewKern; } - SvxCaseMap GetCaseMap() const { return eCaseMap; } void SetCaseMap( const SvxCaseMap eNew ) { eCaseMap = eNew; } // Is-Methods: bool IsCaseMap() const { return SvxCaseMap::NotMapped != eCaseMap; } bool IsCapital() const { return SvxCaseMap::SmallCaps == eCaseMap; } - bool IsKern() const { return 0 != nKern; } bool IsEsc() const { return 0 != nEsc; } // Consider Upper case, Lower case letters etc. diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx index b371990ba11c..222f7d962774 100644 --- a/include/vcl/font.hxx +++ b/include/vcl/font.hxx @@ -133,6 +133,9 @@ public: void SetKerning( FontKerning nKerning ); FontKerning GetKerning() const; bool IsKerning() const; + void SetFixKerning(const short nSpacing); + short GetFixKerning() const; + bool IsFixKerning() const; void SetOutline( bool bOutline ); bool IsOutline() const; diff --git a/include/vcl/rendercontext/SalLayoutFlags.hxx b/include/vcl/rendercontext/SalLayoutFlags.hxx index e8c5901d8528..576a4abd8fbd 100644 --- a/include/vcl/rendercontext/SalLayoutFlags.hxx +++ b/include/vcl/rendercontext/SalLayoutFlags.hxx @@ -30,12 +30,13 @@ enum class SalLayoutFlags DisableKerning = 0x0010, KerningAsian = 0x0020, Vertical = 0x0040, + DisableLigatures = 0x0200, ForFallback = 0x2000, GlyphItemsOnly = 0x4000, }; namespace o3tl { -template <> struct typed_flags<SalLayoutFlags> : is_typed_flags<SalLayoutFlags, 0x6077> +template <> struct typed_flags<SalLayoutFlags> : is_typed_flags<SalLayoutFlags, 0x6277> { }; } |