Bug 142566 - [EMF] PolyTextOut support
Summary: [EMF] PolyTextOut support
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
(earliest affected)
5.2 all versions
Hardware: All All
: low minor
Assignee: Bartosz
Whiteboard: target:7.2.0
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
Reported: 2021-05-30 13:35 UTC by Valek Filippov
Modified: 2021-07-15 07:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

EMF sample with PolyTextOutA (248 bytes, image/x-emf)
2021-05-30 13:36 UTC, Valek Filippov
EMF sample for PolyTextOutW (256 bytes, image/x-emf)
2021-05-30 13:37 UTC, Valek Filippov
How it should look like (1.15 KB, image/png)
2021-05-30 13:39 UTC, Valek Filippov
Comparison LibreOffice 7.2 master and MSO 2010 (72.14 KB, image/png)
2021-05-31 13:58 UTC, Xisco Faulí

Note You need to log in before you can comment on or make changes to this bug.
Description Valek Filippov 2021-05-30 13:35:34 UTC
LO doesn't implement PolyTextOutA/PolyTextOutW EMRs.

Steps to Reproduce:
Open attached EMF sample

Actual Results:
LO shows empty object

Expected Results:
It should show one line of text.

Reproducible: Always

User Profile Reset: No

Additional Info:
Both samples have one PolyTextOut EMR with cString equals 1.
It works fine in MS Paint, Wordpad and MSO.
I was unable to make a working sample with cString greater than 1.
MS Paint/Wordpad didn't open such files, MSO loaded empty object.

Limited implementation could be trivial: inject ReadUInt32 for cString value, create a debug log if the value is above 1, consider only first EmrText object.
Comment 1 Valek Filippov 2021-05-30 13:36:58 UTC
Created attachment 172451 [details]
EMF sample with PolyTextOutA
Comment 2 Valek Filippov 2021-05-30 13:37:26 UTC
Created attachment 172452 [details]
EMF sample for PolyTextOutW
Comment 3 Valek Filippov 2021-05-30 13:39:40 UTC
Created attachment 172453 [details]
How it should look like
Comment 4 Xisco Faulí 2021-05-31 13:58:10 UTC
Created attachment 172499 [details]
Comparison LibreOffice 7.2 master and  MSO 2010
Comment 5 Xisco Faulí 2021-05-31 13:59:09 UTC
Reproduced in

Version: / LibreOffice Community
Build ID: f49e5902a3737c02fabf5bec23243ccb126426c4
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded


Build ID: dd46727b99d4bb5135451aa7e5e1bdb197373843
CPU Threads: 4; OS Version: Linux 5.7; UI Render: default; 
Locale: en-US (en_US.UTF-8)
Comment 6 Commit Notification 2021-06-01 21:49:16 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":


tdf#142566 EMF Add support for EMR_POLYTEXTOUT records

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:

Affected users are encouraged to test the fix and report feedback.