diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-28 14:27:59 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-28 19:32:46 +0100 |
commit | 9914ca04ac6a63f14adcd0fe58b2be44b84ee15f (patch) | |
tree | 4693569a04d79cab122fef8f97f8742858196132 /sw/qa | |
parent | c8e37ef268cae23a92c298721f1493daeda323c2 (diff) |
ODF export: expose font style and weight of embedded fonts
We don't need this info ourselves, but when converting the flat ODF
output to other formats, this information is hard to find out, so state
them explicitly. Names correspond to existing CSS ones, where it's
necessary to state these explicitly. The EPUB export will make use of
these attributes.
(It is unclear why the test fails on the windows_msc_dbgutil_32 slave,
it works for me locally.)
Change-Id: I05030b6a14aca842e5a740786f3743e9ae838293
Reviewed-on: https://gerrit.libreoffice.org/45384
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/odfexport/data/embedded-font-props.odt | bin | 0 -> 8097 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/embedded-font-props.odt b/sw/qa/extras/odfexport/data/embedded-font-props.odt Binary files differnew file mode 100644 index 000000000000..6eb073e29fe0 --- /dev/null +++ b/sw/qa/extras/odfexport/data/embedded-font-props.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 60a1ceef489f..eea19faccea8 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -1668,6 +1668,26 @@ DECLARE_ODFEXPORT_TEST(testImageMimetype, "image-mimetype.odt") } } +DECLARE_ODFEXPORT_TEST(testEmbeddedFontProps, "embedded-font-props.odt") +{ +#if !defined(WNT) + // Test that font style/weight of embedded fonts is exposed. + // Test file is a normal ODT, except EmbedFonts is set to true in settings.xml. + if (xmlDocPtr pXmlDoc = parseExport("content.xml")) + { + // These failed, the attributes were missing. + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]", "font-style", "normal"); + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]", "font-weight", "normal"); + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[2]", "font-style", "normal"); + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[2]", "font-weight", "bold"); + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[3]", "font-style", "italic"); + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[3]", "font-weight", "normal"); + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[4]", "font-style", "italic"); + assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[4]", "font-weight", "bold"); + } +#endif +} + DECLARE_ODFEXPORT_TEST(testTdf100492, "tdf100492.odt") { uno::Reference<drawing::XShape> xShape = getShape(1); |