Bug 77089 - WMF rendering: characters are too wide
Summary: WMF rendering: characters are too wide
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
4.1.5.3 release
Hardware: x86 (IA32) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-05 18:26 UTC by Andras Timar
Modified: 2021-10-18 21:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
rendered in LibreOffice 32-bit (81.77 KB, image/png)
2014-04-05 18:26 UTC, Andras Timar
Details
reference rendering (MS Paint) (116.23 KB, image/png)
2014-04-05 18:27 UTC, Andras Timar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Timar 2014-04-05 18:26:42 UTC
Created attachment 96957 [details]
rendered in LibreOffice 32-bit

Try to open https://bugs.freedesktop.org/attachment.cgi?id=93188 (from bug 74336) on a 32-bit operating system (tested on Mac, Windows, and Linux). The text labels on the graph are too wide, some overlap, some are cut. See also the reference rendering.
Comment 1 Andras Timar 2014-04-05 18:27:25 UTC
Created attachment 96958 [details]
reference rendering (MS Paint)
Comment 2 Tomaz Vajngerl 2014-04-23 11:51:35 UTC
After investigation I found out that MS Office (and MS Paint) renders this image the same as LO (at least concerning the fonts). To show this you have to take the WMF image directly from the PPTX file by unzipping the document. 

The reason that the original PPTX file (when opened in PowerPoint) shows the correctly rendered chart is that the PPTX contains a "oleObject1.bin" (in ppt/embeddings folder inside the document) which I suspect is the original chart data, and uses that for rendering.

Funny, if you export the chart in PowerPoint as a WMF image and use that in LO, then the chart is rendered (almost) perfectly also in LO.
Comment 3 Commit Notification 2014-04-24 20:53:21 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c2d5b59fc6a3b3fbe20a19282538d5f95fa53301

fdo#77089 pass shape dimensions to graphicfilter for WMF



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2014-04-24 20:53:33 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0a1e297ac23ae79ce9d511b4fd6bd0d8276a2e25

fdo#77089 if font width 0, pass 0 - don't take it from font metric



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2014-04-24 20:53:47 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a85317c67f870917231e82eb29fd5023e55b87de

fdo#77089 if available, use ext. dimensions for non-placable WMF



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Jorendc 2014-04-24 20:58:25 UTC
Fixes are applied for this bug, so lets mark it at least as NEW right away :-). Thanks Tomaz!
Comment 7 Andras Timar 2014-04-27 18:14:31 UTC
The bug is fixed but with limitations. The bugdoc is displayed well. 

The WMF will only be rendered correctly (regarding fonts not overlapping) if it gets the dimensions from outside - otherwise not. This WMF is not "placed" - which means according to the specs that it is device dependent and non portable. Currently only oox filters pass the dimensions, others do not. Hopefully it will cover most use cases. 

The alternative is to let "Graphic" rerender from source when a resize happens. All this is not trivial to do.
Comment 8 Hossein 2021-10-18 21:24:36 UTC
This bug is missing a unit test.
The attachment 93188 [details] is the example file tested here.
The changes in the fix https://git.libreoffice.org/core/+/a85317c67f870917231e82eb29fd5023e55b87de%5E%21/ are possibly related to bug 88163.