Apache OpenOffice (AOO) Bugzilla – Issue 122326
SVG: missing text after breaking SVG
Last modified: 2022-10-28 12:54:36 UTC
- New Draw document . Insert any of http://www.w3.org/TR/SVG/images/text/tspan01.svg http://www.w3.org/TR/SVG/images/text/tref01.svg - break the graphic - the text is missing
ALG: The general problem here is that we have no code yet to convert a sequence of primitives to SdrObjects. Thus, the current path is to convert to a metafile and use the existing code to convert metafile to SdrObjects. That code is old and not complete, even if I add stuff from time to time (esp. the last 2 weeks already). A better and full solution would be to change a primitive_to_SdrObject converter what I would love to do, but earliest after 4.0. Still, it's a defect and a good reason to get this done soon.
The problems seems to be in the break operation: - Insert http://www.w3.org/TR/SVG/images/text/tspan01.svg - Convert to metafile - text is there in the metafile - Break the metafile - text is missing
ALG: Yes, that's what I wanted to express with Comment 1.
ALG: Took a look and text is not handled properly. Adding text clipping (as text or as polygons when over clip bounds). Also correcting border distance settings to get the text not offsetted as currently. Adapted example tspan01.svg to have text inside, on and outside the clip region. Clip region: The SVG defines one, thus it's also set in the metafile. It defines one because the viewBox="0 0 1000 300" and the <rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" /> overlap by -1 in x and y since the line of width '2' (which may have been intended to lay inside the definition) is centered on the rectangle.
"alg" committed SVN revision 1483717 into trunk: i122326 added text clipping, corrected text box distances
ALG: Added, done.