Problems with Inkscape SVG images

Having trouble installing Oxygen? Got a bug to report? Post it all here.
cube
Posts: 13
Joined: Mon Jul 29, 2013 6:14 pm

Problems with Inkscape SVG images

Post by cube »

I've creates some SVG-images with Inkscape. Unfortunately they are not rendered correctly in the Author view.

Default:
http://imageshack.com/a/img62/4995/l1fp.png

After changing the "version" attribute in the SVG file from "1.1" to "1.2" the graphic is displayed, but has some rendering issues.
Image

With version=1.2
http://imageshack.com/a/img513/1989/uii9.png

Maybe that is a font issue, tried Sans and Arial. There should be text instead of the black boxes. Any ideas?
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problems with Inkscape SVG images

Post by Radu »

Hi,

Oxygen uses the open-source Batik library to render SVG documents and the library has only partial support for SVG 1.2:

http://xmlgraphics.apache.org/batik/dev/svg12.html

As soon as the Batik library gets updated, we will bundled the new version with Oxygen.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Problems with Inkscape SVG images

Post by adrian »

Hi,

One problem particular to SVG images saved from Inkscape is that they are always tagged as SVG 1.1, even though Inkscape sometimes uses flowing text (flowRoot element) which was introduced in SVG 1.2.
There are various discussions on the web about this:
StackOverflow - How to properly display multiline text in SVG 1.1?

Having said that, as Radu mentioned, Oxygen uses the Batik library for SVG rendering and the current version of Batik (v1.7) only has partial support for SVG 1.2.
I hope hat explains why it partially works when the SVG is tagged as 1.2.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
cube
Posts: 13
Joined: Mon Jul 29, 2013 6:14 pm

Re: Problems with Inkscape SVG images

Post by cube »

Hi Radu and Adrian,

thank you for your quick reply. If I understand you corretly, it should work with SVG 1.1, but when using 1.1 no image is rendered at all. So it is possible to use Oxygen and Inkscape-SVG without having fragments like this? How can I avoid them? Or can you recommend another SVG-Editor?

Thank you and best regards
Stefan
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Problems with Inkscape SVG images

Post by adrian »

Hi,

Unfortunately we do not have first hand experience using Inkscape or any other visual SVG editor for that matter. So we can't make a recommendation in the know.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
cube
Posts: 13
Joined: Mon Jul 29, 2013 6:14 pm

Re: Problems with Inkscape SVG images

Post by cube »

I answer to myself: You must not create "Flowing Text“ with Inkscape, only "Simple Text" works. If you want enter text, do not draw a text frame, just click in the drawing area and start typing. You can try to convert "Flowing Text" to "Simple Text" via the Text menu > Convert to Text. If you still have black frames, open the SVG in text mode and remove all flowRoot elements. This is a known bug: https://bugzilla.gnome.org/show_bug.cgi?id=460904.

You can find more information here (automatically translated with Google Translator from German to English): Wikipedia - Problems with SVGs
mjlorenzi
Posts: 12
Joined: Thu Jul 11, 2019 12:29 am

Re: Problems with Inkscape SVG images

Post by mjlorenzi »

Late to this thread, but discovering this myself. Is this an issue with InkScape or OxygenXML? I'm so done with using SVGs unless they are literally simple line drawings.
Last edited by mjlorenzi on Fri Jan 10, 2020 3:51 am, edited 1 time in total.
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problems with Inkscape SVG images

Post by Radu »

Hi,

Maybe you can write us to support@oxygenxml.com and give a small SVG example that we can look into, also some screenshots with how it looks like when presented in Oxygen. Also give us details about the Oxygen version you are using.
As stated earlier on this thread Oxygen uses the Apache Batik library to render SVG files and it seems to support flow text if the version="1.2" attribute is set on the root element:

https://xmlgraphics.apache.org/batik/de ... l#flowtext

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mjlorenzi
Posts: 12
Joined: Thu Jul 11, 2019 12:29 am

Re: Problems with Inkscape SVG images

Post by mjlorenzi »

Hi Radu,

Here is my quick synopsis what I think is going on:

The problem is the OxygenXML SVG rendering engine does not like FlowRoot. If I convert the SVG to version 1.2 the images show up in Oxygen but fails on publishing.

So:
SVG engine hates "FlowROOT" in SVG 1.1 files.
SVG engine likes "FlowROOT" in SVG 1.2 files
Oxygen does not like SVG 1.2 files

To which someone replied on the Write The Docs Slack channel:
Well, to be fair to Oxygen, SVG 1.2 was never fully developed. In fact, as far as browsers are concerned, it's been rolled into SVG 2.0 development.
See the last section here, "Flavors of SVG": https://developer.mozilla.org/en-US/doc ... troduction

So I think the real culprit here is InkScape for using something that was was not fully developed in SVG 1.1.
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problems with Inkscape SVG images

Post by Radu »

Hi Matt,

I'm also registered on the "Write The Docs Slack" channel but I'm having a hard time following everything so you can tag me if you want an answer there although I prefer the forum because the conversation here is persistent.
Anyway, Oxygen uses the Apache Batik libraries for SVG rendering, both when editing content in the Author visual editing mode and when publishing. You mentioned that the SVG was displayed when editing but not when publishing. This should not happen so if you have an SVG exemplifying this we could try to take a look at it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Rob5624
Posts: 15
Joined: Wed Jan 08, 2014 3:23 pm

Re: Problems with Inkscape SVG images - flowRoot elements

Post by Rob5624 »

Just to add... we lately also encountered a few SVG files that have the <flowRoot> elements and that were created by InkScape.

Digging the web on this I found the following:
- InkScape is merely the only program that at any moment supported the flowRoot element at all
- The flowRoot element was introduced in an early draft SVG 1.2 spec but removed from later versions.

BATIK indicates that it could support the flowRoot element when the SVG header indicates that the SVG version is 1.2, InkScape always saved as 1.1 thereby BATIK does not like this element. (ref: https://xmlgraphics.apache.org/batik/dev/svg12.html)

Summarizing: the <flowRoot> element should be avoided!
I hope that new versions of InkScape remove the flowRoot element when resaving older images.
Post Reply