mltframework / shotcut

cross-platform (Qt), open-source (GPLv3) video editor
https://www.shotcut.org
GNU General Public License v3.0
11.08k stars 1.14k forks source link

SVG text is not rendered properly #1585

Closed petaflot closed 3 weeks ago

petaflot commented 1 month ago

text that is centered and/or wrapped is not displayed properly.

shotcut0 shotcut1

ddennedy commented 1 month ago

You did not provide your OS and Shotcut version. You also did not include your SVG.

Shotcut uses Qt library via MLT to render SVG, and Qt only supports non-animated SVG 1.2 Tiny, which you can read about here. I do not modify the Qt included in our builds or work on Qt myself. Inkscape is not limited to SVG 1.2 Tiny.

SVG has problematic interoperability because it is complex, interpreted, and has many versions. So, it is generally not a reliable format. You can read more about versions on Wikipedia.

Complex multimedia formats work best when you have more control over both the authoring tool and rendering engine. Therefore, I recommend using Glaxnimate (bundled in our builds) for vector graphics that can also be animated.

petaflot commented 1 month ago

currently running Shotcut 24.09.22 on Gentoo (profile: default/linux/amd64/23.0/desktop)

I understand how SVG could be rendered differently by different backends.

Here is the SVG file (I added some complexity that shows other variations of the problem) with some screenshots. Text in top rectangle: multi-line, centered text. Text in bottom rectangle: two single lines, left aligned. There is no animation.

presents_2 1 2

Since a user is likely to use a single editor for SVG (in my case, inkscape), and since most programs insert clues in the SVG document that allows one to know which program was used to create the SVG, I suppose it shouldn't be too hard to use the same program to render the document (either by user config or dynamically based on the file's content).

For now, I will export manually and insert a PNG instead of the SVG. it's as easy as inkscape --export-type="png" my_svg.svg

ddennedy commented 3 weeks ago

I suppose it shouldn't be too hard to use the same program to render the document

That is impossible to automate in an engine of a video editor, or at least a very bad software architecture. That will not be done, but the user can do that.