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/inc | |
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/inc')
-rw-r--r-- | emfio/inc/mtftools.hxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx index 0fb99761d386..cffe5e4fa511 100644 --- a/emfio/inc/mtftools.hxx +++ b/emfio/inc/mtftools.hxx @@ -207,11 +207,13 @@ namespace emfio #define MAC_CHARSET 77 #define BALTIC_CHARSET 186 +#define ETO_OPAQUE 0x0002 #define ETO_CLIPPED 0x0004 /*WINVER >= 0x0400*/ #define ETO_GLYPH_INDEX 0x0010 #define ETO_RTLREADING 0x0080 /*_WIN32_WINNT >= 0x0500*/ +#define ETO_NO_RECT 0x0100 #define ETO_PDY 0x2000 #define DEFAULT_PITCH 0x00 @@ -642,6 +644,7 @@ namespace emfio void LineTo(const Point& rPoint, bool bRecordPath = false); void DrawPixel(const Point& rSource, const Color& rColor); void DrawRect(const tools::Rectangle& rRect, bool bEdge = true); + void DrawRectWithBGColor(const tools::Rectangle& rRect); void DrawRoundRect(const tools::Rectangle& rRect, const Size& rSize); void DrawEllipse(const tools::Rectangle& rRect); void DrawArc( |