Issue 122522

Summary: [SVG import] too thick line segments
Product: Draw Reporter: datbug
Component: open-importAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Normal    
Priority: P3 CC: Armin.Le.Grand, issues, rb.henschel
Version: 4.0.0-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
image showing the behaviour
none
test file
none
Overlayed parts (screenshot from other renderer, SVG in AOO)
none
Reduced example
none
Even further reduced example only showing the LineWidth issue none

Description datbug 2013-06-12 14:35:23 UTC
Created attachment 80827 [details]
image showing the behaviour

XP, AOO400m2(Build:9701) - Rev. 1489073 2013-06-03 13:48:37 (Mo, 03 Jun 2013)
Insert->Picture->From File
short line segments are too thick and look different although created the same way??
Comment 1 datbug 2013-06-12 14:35:46 UTC
Created attachment 80828 [details]
test file
Comment 2 Armin Le Grand 2013-06-14 08:30:42 UTC
ALG: Did a direct overlay with mozilla display, I see two errors:
- The letters at the mulecules are too big (this covers the correct line in example1)
- The lines in 2nd and 3rd example indeed have a linewidth they should not have.
Thanks for the examples, I will have a look!
Comment 3 Armin Le Grand 2013-06-14 08:37:48 UTC
Created attachment 80846 [details]
Overlayed parts (screenshot from other renderer, SVG in AOO)
Comment 4 Armin Le Grand 2013-06-14 08:38:10 UTC
ALG: Grepping
Comment 5 Armin Le Grand 2013-06-14 11:23:21 UTC
ALG: Öetters may be the same as #122524#
Comment 6 Armin Le Grand 2013-06-14 12:40:03 UTC
Created attachment 80848 [details]
Reduced example
Comment 7 Armin Le Grand 2013-06-14 12:44:22 UTC
ALG: Reduced the exaple to only have two lines and the letters of the last molecule. Mozilla and Safari render it the same.

Lines: Each has it's own group, in the group a style with stroke-width, th eline itself also has a stroke-width (same numerical value). The group also defines a transform. Which stroke-width is valid and does it underly the transformation in the parent group?

Letters: text elements have a style element which contains a font-size statement and a direct font-size statement, both numerically different. Which one wins in such a case? Removing the non-style font-size statement makes it look better. Need to check what SVG spec says about such a case.
Comment 8 Armin Le Grand 2013-06-14 16:41:44 UTC
ALG: Letters: Difference is that one font-size is a 'presentation attribute' the other a 'CSS style'. Found something about it in http://www.w3.org/TR/SVG/styling.html#UsingPresentationAttributes, the interesting sentemce is 'In general, this means that the presentation attributes have lower priority than other CSS style rules specified in author style sheets or ‘style’ attributes.'. This means the 'CSS style' font-size should have priority. Checking how to do that for attributes in general...
Comment 9 Armin Le Grand 2013-06-14 17:06:04 UTC
ALG: Okay, done that in SvgNode::parseAttributes (explanation there). comitting this, the 'Letters' part is solved with this.
Comment 10 Armin Le Grand 2013-06-17 12:22:25 UTC
Created attachment 80873 [details]
Even further reduced example only showing the LineWidth issue

ALG: I further reduced the example (added here). Strange:
(a) In Safari, 1st line is very thin, 2nd is normal
(b) In Mozilla it's the same
(c) In Inkscape (ungroup twice) the two lines have the same width

Intended is probably (c), but I cannot see how this happens from the values directly in the SVG. All embeddings in transformations (the groups) have influence on LineWidth, this is taken into account in import. Still, first line is fat, 2nd is not.
Comment 11 Armin Le Grand 2013-06-17 12:25:54 UTC
ALG: Both lines have stroke-width defined twice, once in style at group level, once in style at line level. I am pretty sure the one from Line-level has to be used, thus it will get transformed. That's what is constructed in the import, but result is different from e.g. inkscape.
@Regina (setting on CC): Do you see how/why in inkscape both lines have the same width...?
Comment 12 Marcus 2017-05-20 11:27:28 UTC
Reset assigne to the default "issues@openoffice.apache.org".