diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-05-24 20:05:19 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-05-28 21:47:40 +0200 |
commit | 3a9027609e7ee0c7af457b06426093782ca295a8 (patch) | |
tree | 4f0f6aa86cccc2326e55196d412fe5d02daa8375 /emfio/qa/cppunit/wmf | |
parent | d90aa314961ea4a6893144cd6be66dd71cc2cca1 (diff) |
tdf#53004 tdf#142495 WMF EMF Fix displaying Text with OPAQUE and CLIPPED
With OPAQUE option enabled, the rectangle need to be drawn,
before drawing text.
With CLIPPED option enabled, the text needs to be drawn
only inside rectangle.
In previous implementation, the rectangle read was skipped and
it was not drawn (for OPAQUE).
For CLIPPED the rectangle was read but Clip was not applied
to text drawing
This commit fix that issues, and allow to draw rectangle correctly,
with BGColor (background color), and add support for Text Clipping
according to [MS-WMF] and [MS-EMF] specification.
The fix applied to EMR_EXTTEXTOUTW, EMR_EXTTEXTOUTA and EXTTEXTOUT records
Change-Id: I0f6248bb9465e6d5f797cddb53f058afb0815a2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116072
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/qa/cppunit/wmf')
-rw-r--r-- | emfio/qa/cppunit/wmf/data/TestExtTextOutOpaqueAndClip.wmf | bin | 0 -> 328 bytes | |||
-rw-r--r-- | emfio/qa/cppunit/wmf/wmfimporttest.cxx | 18 |
2 files changed, 12 insertions, 6 deletions
diff --git a/emfio/qa/cppunit/wmf/data/TestExtTextOutOpaqueAndClip.wmf b/emfio/qa/cppunit/wmf/data/TestExtTextOutOpaqueAndClip.wmf Binary files differnew file mode 100644 index 000000000000..fb6fd20f0cb4 --- /dev/null +++ b/emfio/qa/cppunit/wmf/data/TestExtTextOutOpaqueAndClip.wmf diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx b/emfio/qa/cppunit/wmf/wmfimporttest.cxx index 41c15e3989f8..62a669fe3676 100644 --- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx +++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx @@ -206,7 +206,7 @@ void WmfTest::testWorldTransformFontSize() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/font", 8); + assertXPath(pDoc, "/metafile/font", 9); assertXPath(pDoc, "/metafile/font[1]", "color", "#595959"); assertXPath(pDoc, "/metafile/font[1]", "width", "0"); @@ -214,13 +214,19 @@ void WmfTest::testWorldTransformFontSize() assertXPath(pDoc, "/metafile/font[1]", "orientation", "0"); assertXPath(pDoc, "/metafile/font[1]", "weight", "bold"); - // World transform should not affect font size. Rotating text for 90 degrees - // should not exchange font width and height. assertXPath(pDoc, "/metafile/font[3]", "color", "#000000"); assertXPath(pDoc, "/metafile/font[3]", "width", "0"); - assertXPath(pDoc, "/metafile/font[3]", "height", "530"); - assertXPath(pDoc, "/metafile/font[3]", "orientation", "900"); - assertXPath(pDoc, "/metafile/font[3]", "weight", "normal"); + assertXPath(pDoc, "/metafile/font[3]", "height", "389"); + assertXPath(pDoc, "/metafile/font[3]", "orientation", "0"); + assertXPath(pDoc, "/metafile/font[3]", "weight", "bold"); + + // World transform should not affect font size. Rotating text for 90 degrees + // should not exchange font width and height. + assertXPath(pDoc, "/metafile/font[4]", "color", "#000000"); + assertXPath(pDoc, "/metafile/font[4]", "width", "0"); + assertXPath(pDoc, "/metafile/font[4]", "height", "530"); + assertXPath(pDoc, "/metafile/font[4]", "orientation", "900"); + assertXPath(pDoc, "/metafile/font[4]", "weight", "normal"); } void WmfTest::testTdf93750() |