diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/CppunitTest_vcl_svm_test.mk | 2 | ||||
-rw-r--r-- | vcl/qa/cppunit/svm/data/font.svm | bin | 0 -> 320 bytes | |||
-rw-r--r-- | vcl/qa/cppunit/svm/svmtest.cxx | 40 |
3 files changed, 40 insertions, 2 deletions
diff --git a/vcl/CppunitTest_vcl_svm_test.mk b/vcl/CppunitTest_vcl_svm_test.mk index 727ed121e3f6..898cf28c8475 100644 --- a/vcl/CppunitTest_vcl_svm_test.mk +++ b/vcl/CppunitTest_vcl_svm_test.mk @@ -58,4 +58,6 @@ $(eval $(call gb_CppunitTest_use_components,vcl_svm_test,\ $(eval $(call gb_CppunitTest_use_configuration,vcl_svm_test)) +$(eval $(call gb_CppunitTest_use_more_fonts,vcl_svm_test)) + # vim: set noet sw=4 ts=4: diff --git a/vcl/qa/cppunit/svm/data/font.svm b/vcl/qa/cppunit/svm/data/font.svm Binary files differnew file mode 100644 index 000000000000..301e9d3c18ba --- /dev/null +++ b/vcl/qa/cppunit/svm/data/font.svm diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index de0e93363c84..605a8f5c8afd 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -166,7 +166,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools void checkMapMode(const GDIMetaFile& rMetaFile); void testMapMode(); - //void checkFont(const GDIMetaFile& rMetaFile); + void checkFont(const GDIMetaFile& rMetaFile); void testFont(); void checkPushPop(const GDIMetaFile& rMetaFile); @@ -1890,8 +1890,44 @@ void SvmTest::testMapMode() checkMapMode(readFile(u"mapmode.svm")); } +void SvmTest::checkFont(const GDIMetaFile& rMetafile) +{ + xmlDocUniquePtr pDoc = dumpMeta(rMetafile); + assertXPathAttrs(pDoc, "/metafile/font[1]", { + {"color", "#ffffff"}, + {"fillcolor", "#ffffff"}, + {"name", "Liberation Sans"}, + {"stylename", "Regular"}, + {"width", "12"}, + {"height", "12"}, + {"orientation", "50"}, + {"weight", "thin"}, + {"vertical", "true"}, + }); +} + void SvmTest::testFont() -{} +{ +#if HAVE_MORE_FONTS +// Windows interprets Width differently causing build errors +#if !defined(_WIN32) + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance<VirtualDevice> pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + vcl::Font aFont(FontFamily::FAMILY_SCRIPT, Size(15, 15)); + aFont.SetWeight(FontWeight::WEIGHT_THIN); + aFont.SetFamilyName("Liberation Sans"); + aFont.SetStyleName("Regular"); + aFont.SetFontHeight(12); + aFont.SetAverageFontWidth(12); + aFont.SetVertical(true); + aFont.SetOrientation(Degree10(50)); + pVirtualDev->SetFont(aFont); + checkFont(writeAndReadStream(aGDIMetaFile)); + checkFont(readFile(u"font.svm")); +#endif // _WIN32 +#endif +} void SvmTest::checkPushPop(const GDIMetaFile& rMetaFile) { |