diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/font/font.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/CommonSalLayout.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 13 | ||||
-rw-r--r-- | vcl/source/outdev/outdev.cxx | 1 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 4 |
6 files changed, 11 insertions, 19 deletions
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index 3db74fce047a..84aeb02baabe 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -211,7 +211,7 @@ void Font::SetKerning( FontKerning eKerning ) bool Font::IsKerning() const { - return bool(mpImplFont->meKerning & FontKerning::FontSpecific); + return !(mpImplFont->meKerning == FontKerning::NONE); } void Font::SetWeight( FontWeight eWeight ) @@ -729,7 +729,7 @@ ImplFont::ImplFont() : meStrikeout( STRIKEOUT_NONE ), meRelief( FontRelief::NONE ), meEmphasisMark( FontEmphasisMark::NONE ), - meKerning( FontKerning::NONE ), + meKerning( FontKerning::FontSpecific ), meCharSet( RTL_TEXTENCODING_DONTKNOW ), maLanguageTag( LANGUAGE_DONTKNOW ), maCJKLanguageTag( LANGUAGE_DONTKNOW ), diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 36a19314816e..06b815f56be6 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -456,6 +456,12 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs) hb_buffer_set_unicode_funcs(pHbBuffer, pHbUnicodeFuncs); #endif + if (rArgs.mnFlags & SalLayoutFlags::DisableKerning) + { + SAL_INFO("vcl.harfbuzz", "Disabling kerning for font: " << mrFontSelData.maTargetName); + maFeatures.push_back({ HB_TAG('k','e','r','n'), 0, 0, static_cast<unsigned int>(-1) }); + } + ParseFeatures(mrFontSelData.maTargetName); double nXScale = 0; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 88f02d66f6fa..b37f9b0e0ebf 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -68,7 +68,7 @@ std::ostream &operator <<(std::ostream& s, ImplLayoutArgs &rArgs) TEST(BiDiRtl); TEST(BiDiStrong); TEST(RightAlign); - TEST(KerningPairs); + TEST(DisableKerning); TEST(KerningAsian); TEST(Vertical); TEST(EnableLigatures); diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 847de1bfff84..0794bd13d359 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1106,19 +1106,6 @@ bool OutputDevice::ImplNewFont() const } } - // enable kerning array if requested - if ( maFont.GetKerning() & FontKerning::FontSpecific ) - { - mbKerning = true; - } - else - { - mbKerning = false; - } - - if ( maFont.GetKerning() & FontKerning::Asian ) - mbKerning = true; - // calculate EmphasisArea mnEmphasisAscent = 0; mnEmphasisDescent = 0; diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index d99ad88a6caa..787da984bd7c 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -105,7 +105,6 @@ OutputDevice::OutputDevice() : mbInitTextColor = true; mbInitClipRegion = true; mbClipRegionSet = false; - mbKerning = false; mbNewFont = true; mbTextLines = false; mbTextSpecial = false; diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 7aa669f5ad37..ba946d3914fa 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1179,8 +1179,8 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr, nLayoutFlags |= SalLayoutFlags::BiDiStrong; } - if( mbKerning ) - nLayoutFlags |= SalLayoutFlags::KerningPairs; + if( !maFont.IsKerning() ) + nLayoutFlags |= SalLayoutFlags::DisableKerning; if( maFont.GetKerning() & FontKerning::Asian ) nLayoutFlags |= SalLayoutFlags::KerningAsian; if( maFont.IsVertical() ) |