Open tomschr opened 3 years ago
Using rsvg instead of Inkscape will bring rather predictable conversion issues, especially (but not limited to) when graphics have been originally created with Inkscape, e.g. when they use the flowRoot text element.
You are right that Inkscape is huge and drags in a lot more dependencies than we want though.
We've discussed this topic during our sync call. Probably we will have issues with the svg:flowRoot
tag which is likely to be unsupported by rsvg-convert
.
I've tried to create a test but was unable to find a svg:flowRoot
tag in my SVG with Inkscape 1.0.2. Digging a bit deeper, I found this:
»The SVG 1.2 Full specification was never completed (as you can see from the link it's still in draft from 2005) and only Inkscape ever supported flowRoot I think. I don't think it's intended that flowRoot will be part of SVG 2 either as that is likely to implement flowing text with a different and more CSS compatible mechanism so flowRoot is best avoided.« Source: https://stackoverflow.com/a/19391378
which seem to explain why it doesn't appear anymore. I can also save my SVG in Inkscape as version 1.1, not as 1.2. I'm pretty sure this flowRoot was available in the pre 1.0 version.
I've also looked into our images/srv/svg
and haven't found any occurances of flowRoot (as it was to be expected). Sooo... to make a long story short, maybe this flowRoot isn't a big deal anymore. For SVG images which are created by other tools, you can convert the flow text into some static presentation (use main menu "Text > Unflow" or "Text > Convert to Text").
However, we may still have other conversion issues when using rsvg-convert
. To clarify which elements and attributes are actually supported, I've created issue 801 in the upstream project. Let's see if they find it useful.
Maybe we need to compare if there are any differences between the Inkscape generated PNGs and the rsvg-convert
generated ones. After then we can decide if this is going to fly or not.
I've investigated a little bit further and wrote a small (dirty) Shell script that you can run on any cloned repo. It a) converts each SVG to PNG with rsvg-convert and inkscape and b) compares the result of the two PNGs with compare
(ImageMagick).
My findings so far:
(use main menu "Text > Unflow"
Aah, good to know! I never knew this tool existed!
In the past, Inkscape created flowRoots when dragging open a bounding box first rather than just clicking and then typing. However, I just tried it on Inkscape 1.0.1 (the version that ships in Leap 15.3) and, you're right, it does not create flowRoots in either case! Progress! Awesome.
After some further tests, the xmlgraphics-batik-rasterizer
script makes the best output from what I can see. It's based on Batik, a SVG library which supports a lot of features.
If we really want to move away from Inkscape, it could be an alternative. However, it's Java, so it's not as fast as Inkscape or rsvg-convert
. :disappointed:
However, we probably already need the Batik rasterizer because we use FOP. So, speed and java-ness aside, if Batik is a good implementation of SVG and runs reliably, then using that as broadly as possible sounds like a good idea. (edit We have our troubles with FOP... and switching away from FOP has been on my mind more than once. That might play into this decision too.)
I just checked how the Dia pipeline works and it seems that is already independent from Inkscape -- DAPS currently allows DIA->PNG and DIA->SVG but both only use the dia
command, e.g.
DIA->PNG -- make/images.mk:448:
LANG=C dia -t png --export=$@ $< $(DEVNULL) $(ERR_DEVNULL)
Analogously on l. 520 for DIA->SVG.
I will work on this one. This is the only reason why SLFO:Main:Build has curently inkscape. And it's ridiculous that SLES with almost no desktop has inkscape in it. Once the dependency from daps is gone, we can keep inkscape simply in Leap and offer it to sles via PACKAGEHUB. Thx
Problem description
Some time ago we had some issues with Inkscape:
It seems we could replaces Inkscape with a more light-weight tool.
Idea
I got informed that Fedora had some problems with Inkscape too (see [1]). This was mainly for the dblatex tool, but it should be correct for daps as well. Originally, the bug was filed in [2], but it seems the Inkscape won't fix it. Fedora created a patch[3] because of this which basically replaces
inkscape
withrsvg-convert
.We need to check if:
References