From 07cac0079fce384ce0e97875d84bc7c9888ed94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Thu, 5 Jul 2018 15:21:51 +0200 Subject: [PATCH] FontFeatureTest set weight/italcs explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Font featrues can depend on the state. To make the state more stable we need to set the the font properties explicitly. This sets the weight, italics, width type to "NORMAL", which changes the number of available features. Change-Id: Ida6be4191762c3acfeb7b95182b80717e9774c62 Reviewed-on: https://gerrit.libreoffice.org/57011 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/qa/cppunit/FontFeatureTest.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx index 018c3ee222e4..b37cac87a283 100644 --- a/vcl/qa/cppunit/FontFeatureTest.cxx +++ b/vcl/qa/cppunit/FontFeatureTest.cxx @@ -43,8 +43,15 @@ void FontFeatureTest::testGetFontFeatures() DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); aVDev->SetOutputSizePixel(Size(10, 10)); + OUString aFontName("Linux Libertine G"); + if (aVDev->IsFontAvailable(aFontName)) + return; // Can't test this because the font is not available, so exit + vcl::Font aFont = aVDev->GetFont(); aFont.SetFamilyName("Linux Libertine G"); + aFont.SetWeight(FontWeight::WEIGHT_NORMAL); + aFont.SetItalic(FontItalic::ITALIC_NORMAL); + aFont.SetWidthType(FontWidth::WIDTH_NORMAL); aVDev->SetFont(aFont); std::vector rFontFeatures; @@ -63,12 +70,11 @@ void FontFeatureTest::testGetFontFeatures() } } - CPPUNIT_ASSERT_EQUAL(size_t(27), rDefaultFontFeatures.size()); + CPPUNIT_ASSERT_EQUAL(size_t(20), rDefaultFontFeatures.size()); OUString aExpectedFeaturesString = "aalt c2sc case dlig frac hlig liga lnum " - "nalt onum pnum salt sinf smcp ss01 ss02 " - "ss03 ss04 ss05 ss06 sups tnum zero cpsp " - "kern lfbd rtbd "; + "onum pnum salt sinf smcp ss01 ss02 ss03 " + "sups tnum zero cpsp "; CPPUNIT_ASSERT_EQUAL(aExpectedFeaturesString, aFeaturesString); // Check C2SC feature