Bug 96046 - SVG: Units are converted incorrectly
Summary: SVG: Units are converted incorrectly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks: SVG-Open
  Show dependency treegraph
 
Reported: 2015-11-24 17:09 UTC by Xisco Faulí
Modified: 2018-06-20 17:03 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
font-size applied to text (780 bytes, image/svg+xml)
2015-11-24 17:09 UTC, Xisco Faulí
Details
another sample from W3 (1.77 KB, image/svg+xml)
2015-11-24 17:10 UTC, Xisco Faulí
Details
text units using dpi 90 (2.25 KB, image/svg+xml)
2015-11-25 14:38 UTC, Xisco Faulí
Details
how it looks in Inkscape (41.27 KB, image/jpeg)
2015-11-25 14:40 UTC, Xisco Faulí
Details
72 vs 90 (719 bytes, image/svg+xml)
2015-11-26 15:27 UTC, Xisco Faulí
Details
comparison 72 dpi vs 90 dpi (24.01 KB, image/jpeg)
2015-11-26 15:27 UTC, Xisco Faulí
Details
other properties unhandled (837 bytes, image/svg+xml)
2015-12-01 11:48 UTC, Xisco Faulí
Details
font-sizes unhandled (1.24 KB, image/svg+xml)
2015-12-02 01:33 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2015-11-24 17:09:56 UTC
Created attachment 120767 [details]
font-size applied to text

More information: http://www.w3.org/TR/SVG/coords.html#Units

Some example attached
Comment 1 Xisco Faulí 2015-11-24 17:10:49 UTC
Created attachment 120768 [details]
another sample from W3
Comment 2 V Stuart Foote 2015-11-24 17:46:44 UTC
@Xisco, *

I know this is for your ongoing work on the import filter. Both the text.svg and Units.svg test files are a mess.

But if instead inserting as image(s), the text.svg gets a horribly oversize bounding box. The Units.svg insert does seem correct.

Stuart
Comment 3 Xisco Faulí 2015-11-24 18:06:01 UTC
Units.svg is also wrong at importing time as the two small boxes in abs. units are slighly different, but they should have the same size
Comment 4 V Stuart Foote 2015-11-24 18:23:40 UTC
(In reply to Xisco Faulí from comment #3)
> Units.svg is also wrong at importing time as the two small boxes in abs.
> units are slighly different, but they should have the same size

OK, I see that now--and I know you weren't really focusing on the svgio insert filter. Really just a sidebar comment.

The filter/source/svg really needs the Love you're giving it!  Of course I'm happy to test anything.
Comment 5 Xisco Faulí 2015-11-24 18:53:40 UTC
After some investigation, I don't think there's a bug in svgio.
When you compare it with Firefox or Chrome you can see some differences but not if you compare it with Inkscape. The reason is Chrome and Firefox use 96 pixel per inch while inkscape or svgio use 90, so I believe it's good as it's.
Comment 6 Xisco Faulí 2015-11-25 14:38:31 UTC
Created attachment 120790 [details]
text units using dpi 90
Comment 7 Xisco Faulí 2015-11-25 14:40:51 UTC
Created attachment 120791 [details]
how it looks in Inkscape
Comment 8 Xisco Faulí 2015-11-25 14:47:06 UTC
The first problem I see, apart from the obvious percentage problem, is that EM and EX units aren't displayed at all. That's due to the fact that the 'e' from 'em' or 'ex' is parsed as an exponential by the real_p in http://opengrok.libreoffice.org/xref/core/filter/source/svg/units.cxx#79.

A fix is on its way.
Comment 9 Commit Notification 2015-11-26 12:19:35 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96046 SVG: Parse 'em' and 'ex' units correctly

It will be available in 5.1.0.

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 10 Xisco Faulí 2015-11-26 15:27:05 UTC
Created attachment 120819 [details]
72 vs 90
Comment 11 Xisco Faulí 2015-11-26 15:27:50 UTC
Created attachment 120820 [details]
comparison 72 dpi vs 90 dpi
Comment 12 Adolfo Jayme Barrientos 2015-11-26 18:47:48 UTC
(Master is actually 5.2.0 now.)
Comment 13 Commit Notification 2015-11-27 16:15:14 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96046 SVG: use the same PPI as in svgio

It will be available in 5.2.0.

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 14 Commit Notification 2015-12-01 09:09:35 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96046 SVG: Fix problem when percentage depends ...

It will be available in 5.2.0.

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 15 Xisco Faulí 2015-12-01 11:48:31 UTC
Created attachment 120922 [details]
other properties unhandled
Comment 16 Xisco Faulí 2015-12-02 01:33:14 UTC
Created attachment 120940 [details]
font-sizes unhandled
Comment 17 Robinson Tryon (qubit) 2015-12-10 04:37:48 UTC Comment hidden (obsolete)
Comment 18 Commit Notification 2016-01-08 09:37:58 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96046 SVG: Change logic to parse doubles correctly and..

It will be available in 5.2.0.

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.