OpenShot / openshot-qt

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.
http://www.openshot.org
Other
4.35k stars 544 forks source link

SVG files are not rendered properly #4423

Closed petaflot closed 1 year ago

petaflot commented 3 years ago

Describe the bug When adding slides such as titles and editing them with inkscape (the default?), I noticed centered text is not centered.

I didn't check further for other bugs.

Steps to reproduce the behavior: 1a. edit a default title "slide", set the text and use the "centered text" option 1b. make an SVG from scratch with a centered text, to use as a frame (or group of frames)

  1. import it
  2. watch the result : the text is way off the left side of the frame, not centered

Expected behavior the SVG should be displayed in openshot the way it is displayed in ie. inskcape

Workaround

Open each SVG file individually, export it as PNG with inkscape (with the desired resolution) and import this instead. While this would be easy to script within openshot, it's quite a pain to do manually - especially when an SVG is modified eg. when a typo is found.

System Details

Log Files

Exception / Stacktrace No stacktrace found in log files

ferdnyc commented 3 years ago

Hmm. This may be a font-replacement issue. IIRC when Inkscape centers text, if not told otherwise (there are multiple ways) it inserts a text bounding box and centers that. So, if the text is rendered with a font that has a different width, it can end up off center.

One question is exactly HOW you're centering the text, since like I said there are different ways to do that in Inkscape. A sample SVG file would be helpful, but I'll try to play with this and see if I can reproduce.

petaflot commented 3 years ago

Here's one:

http://dpaste.com/G25U43QGD

Since I installed a new font yesterday, I restarted openshot ; by misake I launched the packaged 0.2.5-r1 and noticed the alignment was mostly worse (text was also vertically offset) EXCEPT for that new font* I had just installed (for the rest I use NoTo Sans).

http://dpaste.com/B8VQBHL8X

With the daily nightbuild from two days ago, that new font is also completely offset (in fact so offset it's out of the canvas)

petaflot commented 3 years ago

I tried to render once.. just to see how it would turn out.

I noticed on this one title slide, the text is rendered right-aligned instead of centered...

http://dpaste.com/7PF73AJY5

As for how I center the text, I create a text block, type my text, select all of the text and chose the "center text" entry in the toolbar's dropdown. Then I hit F1, select the text block, and center it relative to the page.

Colorjet3 commented 1 year ago

There have been many fixes and you can find them in the latest DEV Daily build of v3.0.0.