Bug 142161 - [EMF] PenStyle rendering is inaccurate, PS_INSIDEFRAME is incorrect
Summary: [EMF] PenStyle rendering is inaccurate, PS_INSIDEFRAME is incorrect
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
(earliest affected)
5.2 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
Reported: 2021-05-07 21:24 UTC by Valek Filippov
Modified: 2023-05-12 03:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

EMF sample with different pen styles (720 bytes, image/x-emf)
2021-05-07 21:25 UTC, Valek Filippov
Screenshot of the sample EMF file opened in MS Paint (10.33 KB, image/png)
2021-05-07 21:26 UTC, Valek Filippov
WMF sample for pen styles (324 bytes, image/x-wmf)
2021-05-07 21:52 UTC, Valek Filippov
How it looks in LibreOffice 7.2 master (29.91 KB, image/png)
2021-05-11 08:05 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-07 21:24:28 UTC
LO seems to wrongly scale dashes in pen strokes and not consider PS_INSIDEFRAME for PenStyle in EMF.

Steps to Reproduce:
Open attached EMF sample.

Actual Results:
LO draws almost solid lines with a minimal gaps. Middle shape in the bottom row has the same size as other shapes.

Expected Results:
MS seems to use pen width to calculate the radius of the dots and add a gap of about same size between dots and/or dashes.
Width of the pen have to be equally distributed on both side of the path for all pens except PS_INSIDEFRAME (middle in the bottom row).
For PS_INSIDEFRAME according to the spec all width of the pen should be used inside of the path -- the shape size should match with BBox.

Reproducible: Always

User Profile Reset: No

Additional Info:
Thin black lines are added to highlight the difference. Y-coord for them are 200, 210, 360. Shapes on the bottom line have their Ymin/Ymax at 210 and 360.
Pen width is 20.
Comment 1 Valek Filippov 2021-05-07 21:25:20 UTC
Created attachment 171771 [details]
EMF sample with different pen styles
Comment 2 Valek Filippov 2021-05-07 21:26:51 UTC
Created attachment 171772 [details]
Screenshot of the sample EMF file opened in MS Paint
Comment 3 Valek Filippov 2021-05-07 21:52:09 UTC
Created attachment 171773 [details]
WMF sample for pen styles
Comment 4 Valek Filippov 2021-05-07 22:10:11 UTC
For WMF pen styles seems to be completely ignored.
WMF uses CreatePenIndirect MR.
EMF uses CreatePen MR.
Comment 5 Xisco Faulí 2021-05-11 08:05:49 UTC
Created attachment 171867 [details]
How it looks in LibreOffice 7.2 master
Comment 6 Xisco Faulí 2021-05-11 08:14:04 UTC
Penstyles are displayed like in the screenshot since

author	Chris Sherlock <chris.sherlock79@gmail.com>	2016-03-03 21:52:49 +1100
committer	Chris Sherlock <chris.sherlock79@gmail.com>	2016-03-04 18:23:15 +0000
commit 6381d26d73c614681601fda4a49c96e11a0e6f06 (patch)
tree 2ef7c86fa0490ef6b3cddb6ebb49e2b29309aba3
parent c788f63726df3340e787bb92477d7ad31e7bc952 (diff)
tdf#79679 vcl: dashed lines show as solid lines when importing EMF files

Before this commit they were displayed a a solid line.

@Chris Sherlock, I thought you might be interested in this issue
Comment 7 QA Administrators 2023-05-12 03:19:58 UTC
Dear Valek Filippov,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team