SVG text cross compatibility between Krita and Inkscape
Hi, I'm opening a thread here about my beta-testing effort to make work cross-compatibility between Krita and Inkscape SVG text.
Context:
On my webcomic Pepper&Carrot, when I storyboard my page in Krita, I add text and vector speechbubbles. That's something good to prototype my scenes, dialogues, etc. But I can't use the Krita files into production: the translation system I invented for my webcomic use Inkscape SVG files. This files are more lightweight and perfect for Git. So, since last 5 years I redrew for every episodes all speechbubbles in Inkscape and retype all my text and used Krita just to prototype. Retyping and retracing is a redudant effort that cost me up to two days of (boring) work on long episodes. But since a little year, Krita switched its vector engine from ODG to SVG so I try to make "Export layer as SVG" options to work for me. I post an issue here because Inkscape team are sure the SVG expert I need for help me (I'm not blaming W3C, not Inkscape, not Krita).
My tests:
I drew a SVG file from scratch in Krita 4.2.6appimage to ease test: FreeSans font, a small 512x512px size and only vector elements. I then export it with Layer → Import/Export → Save Layer as SVG and open the result into Inkscape 1.1betaAppimage (kra and svg file in attachement).
Problems:
At a first sight with a side by side comparison, it looks like 99% of the compatibility works already! But when going into the details, the font-size renders slightly smaller while keeping the same line-height (it's visible thanks to the line I added over the speechbubble). The most severe bug happens when I edit a text, the selected lines stack over themselves making the text box impossible to edit:
Tweaks and workaround:
To workaround that, I experimented and found "something" with sed over the SVG:
-
Replace
<tspan
with<tspan sodipodi:role="line"
-
Replace
dy="
byy="
and then the text can be edited in Inkscape and has a better ratio of font-size and line-height (but smaller and misplaced on opening). So, it requires a manual adjustement to make it looks good. With a bash-script to automatize this sed replacement; I can probably save time over retyping/retracing all my text and ballons...
Questions:
- Is it possible to improve my workarounds?
- Is it interesting for Inkscape to have this workaround built-in?
- Should I request Krita team to output something else as SVG?
I'm open to any ideas to make this work. Thanks for the time reading this and thanks for the time you'll put even adding a small comment with an info.
Attachement:
02_Exported-SVG-from-Krita.svg