Issue 124610 - SVG text import looses formatting
Summary: SVG text import looses formatting
Alias: None
Product: Draw
Classification: Application
Component: ui (show other issues)
Version: 4.1.0-dev
Hardware: Mac OS X 10.9
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2014-04-05 17:49 UTC by Thorsten Wagner
Modified: 2017-05-20 10:44 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Sample drawing (10.00 KB, application/
2014-04-05 17:49 UTC, Thorsten Wagner
no flags Details
SVG export (4.36 KB, image/svg+xml)
2014-04-05 17:50 UTC, Thorsten Wagner
no flags Details
Screenshot of imported SVG image (169.93 KB, image/png)
2014-04-05 17:50 UTC, Thorsten Wagner
no flags Details
Screenshot 2 (215.04 KB, image/png)
2014-04-10 23:31 UTC, Thorsten Wagner
no flags Details
Screenshot 3 (204.44 KB, image/png)
2014-04-10 23:32 UTC, Thorsten Wagner
no flags Details
Sample drawing (198.20 KB, application/
2014-07-31 22:31 UTC, Thorsten Wagner
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Thorsten Wagner 2014-04-05 17:49:28 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.
Comment 1 Thorsten Wagner 2014-04-05 17:49:49 UTC
Created attachment 83100 [details]
Sample drawing
Comment 2 Thorsten Wagner 2014-04-05 17:50:07 UTC
Created attachment 83101 [details]
SVG export
Comment 3 Thorsten Wagner 2014-04-05 17:50:52 UTC
Created attachment 83102 [details]
Screenshot of imported SVG image
Comment 4 Edwin Sharp 2014-04-06 06:35:54 UTC
Can not reproduce with
AOO410m15(Build:9761)  -  Rev. 1583666
2014-04-01 13:50 - Linux x86_64
Comment 5 Rainer Bielefeld 2014-04-06 07:27:35 UTC
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 ...)?
Comment 6 Thorsten Wagner 2014-04-07 23:04:19 UTC
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.
Comment 7 Armin Le Grand 2014-04-08 09:33:53 UTC
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...?
Comment 8 Armin Le Grand 2014-04-08 09:34:34 UTC
Forgot: On Win7 these are the same, the orig text object has Arial 18 and the re-imported, break SVG also...
Comment 9 Thorsten Wagner 2014-04-10 23:31:02 UTC
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.
Comment 10 Thorsten Wagner 2014-04-10 23:31:52 UTC
Created attachment 83165 [details]
Screenshot 2
Comment 11 Thorsten Wagner 2014-04-10 23:32:16 UTC
Created attachment 83166 [details]
Screenshot 3
Comment 12 Thorsten Wagner 2014-04-13 10:21:39 UTC
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?
Comment 13 Armin Le Grand 2014-04-14 09:08:38 UTC
@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>

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>

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...
Comment 14 Thorsten Wagner 2014-04-14 19:58:53 UTC
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.
Comment 15 Thorsten Wagner 2014-04-14 20:26:47 UTC
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.
Comment 16 Armin Le Grand 2014-04-15 08:56:36 UTC
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.
Comment 17 Thorsten Wagner 2014-07-31 22:29:38 UTC
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.
Comment 18 Thorsten Wagner 2014-07-31 22:31:04 UTC
Created attachment 83761 [details]
Sample drawing
Comment 19 Armin Le Grand 2014-08-01 08:47:03 UTC
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..
Comment 20 Armin Le Grand 2014-08-01 08:47:18 UTC
Grepping (changing owner)
Comment 21 Marcus 2017-05-20 10:44:41 UTC
Reset the assignee to the default "".