diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2017-02-12 11:08:59 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-14 14:50:12 +0000 |
commit | ded07624096183ed310187f29d4692bb39b7d24a (patch) | |
tree | 97cd5a53d45253defc9b3e45716b85014253c281 /vcl | |
parent | d3b9b4e41e31ce276d2d7354602a586b300adee9 (diff) |
tdf#105454: Stop ignoring font kerning setting
Make sure the default is for kerning to be enable, and honor the setting
to disable it.
This also updates the expectations for chart2_xshape tests for file that
had kerning disabled and was previously ignored.
Change-Id: Icf6bb75e71cae43868fba323ca3c61e4a3e81523
Reviewed-on: https://gerrit.libreoffice.org/34169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
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() ) |