Apache OpenOffice (AOO) Bugzilla – Issue 124610
SVG text import looses formatting
Last modified: 2017-05-20 10:44:41 UTC
When exporting a drawing containing text to SVG and importing the SVG image again text formatting is lost. Steps to reproduce: (1) Load sample drawing (attached to the ticket) (3) Export drawing to SVG (see attached file "Sample.svg") (4) Import exported SVG image (see attached screenshot) The problem appears on Mac OS X 10.9.2 with OpenOffice 4.1 revision 1582709 from trunk, but seems to exist in earlier revisions too.
Created attachment 83100 [details] Sample drawing
Created attachment 83101 [details] SVG export
Created attachment 83102 [details] Screenshot of imported SVG image
Can not reproduce with AOO410m15(Build:9761) - Rev. 1583666 2014-04-01 13:50 - Linux x86_64 Debian
Also NOT reproducible with server installation of "AOO 4.1.0-dev – English UI / German locale - [AOO410m14(Build:9760) - Rev. 1583418_2014-04-02]" on German WIN7 Home Premium (64bit)", own separate user profile. I can open " SVG export" with Draw or import it to a DRAW document, problem shown in screenshot does not exist for me. Also with an own export from Sample drawing everything works fine. Mac only? Additional conditions (Installed Extensins ...)?
The problem seems to be related to Mac OS X and to AOO 4.1. It does not occur on Windows with AOO 4.0.1 as well as on Mac OS X with AOO 4.0.1.
Can you please compare the used font and font size in the text object - text edit the original, break the re-imprted SVG (context menu) and tell if these are different...?
Forgot: On Win7 these are the same, the orig text object has Arial 18 and the re-imported, break SVG also...
After breaking the reimported SVG image text looks good again. Font is Arial 18 pt. Screenshot 2 shows the result after reimporting, screenshot 3 shows the result after breaking.
Created attachment 83165 [details] Screenshot 2
Created attachment 83166 [details] Screenshot 3
I retested with other AOO builds: (1) AOO 4.1 RC 2 is affected by the problem shown in screenshot 2 too. (2) AOO 4.0.1 is not affected. @ Armin: Are you able to confirm this?
@Thorsten: Tried again with AOO401 and AOO410 on Win7, cannot reproduce. It may be mac specific, though. When I compare the created svg's there are indeed differences in the text export line. In your example from comment 2 it is: <text x="6550" y="11339"> <tspan x="6550 6939 7291 7608 7786 7960 8349 8701 9018 9196 9374 9759 10114 10432">Text Text Text</tspan></text> </g> while on win7 I get: <text x="6550" y="11335"> <tspan x="6550 6872 7223 7536 7714 7879 8201 8552 8866 9043 9209 9530 9882 10195">Text Text Text</tspan></text> </g> When I copy that line to the mac-exported version all works as in the win7 version (as expected). Both claim to use "Arial embedded" but produce slightly different embedded font info in the exported SVGs. I would guess these are unavoidable system differences, though. The embedded font is currently not used at the import, but when it would lead to either not assigning Arial to the object when breaking or having a 2nd Arial font (?). It's definitely system-specific - fonts seem to be different on mac and win. I think both work correct, but when using the Arial from Win7 on Arial exported from Mac (or vice-versa) there will be slight differences, not sure what to do about that...
Armin, I'm not sure we are talking about the same problem. Looking at screenshots 2 and 3 there are not only slight differences. Screenshot 2 shows the text streched nearly to the width of the object. Breaking the object shrinks the text back to the original width. I assume a general problem with displaying text within SVG objects related to the 64 bit version of AOO on Mac OS X.
Copying the fragment from the Windows 7 export (comment 13) into the Mac OS X exported SVG file produces a similar result as shown in screenshot 2. Differences between Windows 7 and Mac OS X font handling are not the problem.
Hi Thorsten, Yes, I also see the differences and they are not small, do not get me wrong here. They must be caused by something on the mac 64bit version, as seen the part describing the text (including the embedded font) is different, even with the same font. Thus, this has to be analyzed why mac64 does something different here (is the font really different, or is it internally, VCL and others (the svg export is the same))... Comment 15 is strange, when I replaced the part with the win7 one it looked the same. Which viewer did you use to check the changed SVG? Maybe you used one which uses the embedded font, that again contains char spacings (charwidths), so maybe you also shoud change the embedded font. Nonetheless, an error which is somehow caused on mac64 bit in the system-dependent part concerning the fonts (Herbert is already on cc). Setting to confirmed.
Please find attached another example to show the problem: (1) Page 1 within "Sample 2.odg" is the original drawing. (2) Page 2 within "Sample 2.odg" is the imported SVG produced from page 1. Comparing page 1 and page 2 there are several lines of test with different lenghths. Using SVG on Mac OS/X is nearly impossible as long as the problem exists. As there is currently a lot of development progress regarding SVG it would be very nice to get this problem resolved too.
Created attachment 83761 [details] Sample drawing
Hi Thorsten, hdu - which may tell something about tspan values on the mac - is on CC, waiting for infos myself. It definitely is system-dependent..
Grepping (changing owner)
Reset the assignee to the default "issues@openoffice.apache.org".