Description: LO ignores ETO_OPAQUE and ETO_CLIP flags of he EmrText object. Steps to Reproduce: Open attached EMF sample Actual Results: Three lines of the same text with red, green and blue background approx. the height of the text. Expected Results: Lines with green and blue backgrounds should be clipped right behind the left stem of the letter "D". Green line is also clipped at the top. Blue line background height is greater than the text, extra size goes down. Additional red rectangle is shown in the top left corner. Reproducible: Always User Profile Reset: No Additional Info: Additional rectangle is the result of using the combination of ETO_OPAQUE flag and rectangle with the coordinates different from text position.
Created attachment 172355 [details] EMF sample with ETO_OPAQUE/ETO_CLIP flags
Created attachment 172356 [details] Screenshot of the sample EMF file opened in MS Paint
Created attachment 172357 [details] EMF sample with text rotated by 'Escapement' Implementation in MS Paint/Wordpad looks weird
Created attachment 172358 [details] EMF sample with world rotated by XForm Presence of m12 or m21 in XForm seems to cancel ETO_OPAQUE
Created attachment 172359 [details] EMF sample with world skewed by XForm
Created attachment 172360 [details] EMF sample with world scaled by XForm Scaling applies to ETO_OPAQUE
Created attachment 172361 [details] EMF sample with world rotated by XForm Better sample with rotation. Observation about m12/m21 wasn't correct.
Created attachment 172362 [details] Screenshot with skew
Created attachment 172363 [details] Screenshot with rotation by XForm Sample was changed to make empty red rectangle visible and the size of the blue OPAQUE area more prominent.
Created attachment 172364 [details] Screenshot with Escapement
Created attachment 172365 [details] Screenshot with scale
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3a9027609e7ee0c7af457b06426093782ca295a8 tdf#53004 tdf#142495 WMF EMF Fix displaying Text with OPAQUE and CLIPPED It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Newer versions of LTSpice allows export to EMF (instead of WMF in older versions) and using ETO_OPAQUE extensively. I verified that with this fix the import is correct for LTSpiceXVII.
Created attachment 172439 [details] EMF sample with ETO_OPAQUE and SetBKMode = 1 Looks like ETO_OPAQUE wins over SetBKMode == 1 (Transparent) for filling the rectangle. MS Paint and Wordpad show red logo on this sample, while fixed version of LO doesn't.
Created attachment 172440 [details] How ETO_OPAQUE with SetBKMode=1 should look like
Created attachment 172450 [details] EMF image created by LTSplice
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f275c4b31f095193b80cb756f8610c16282fb8f4 tdf#53004 tdf#142495 WMF EMF Always display Text rectangle It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.