Font-family from title template always reverts to sans-serif
Describe the bug: The font-family set in the SVG file of a title template is ignored and always set to sans-serif (DejaVu Sans in my case) when initially created. It can be edited, but initially is always set to the default sans-serif font.
I have tested the issue using DejaVu Serif, C059, EB Garamond, and Liberation Serif fonts. They all revert to DejaVu Sans the same way.
Issue #5115 also mentions the font being changed, but has more issues relating to font rendering (colour, stroke, etc.) and the comments went on tangents that do not apply in this case. So I am filing this issue to focus on the font-family not being preserved in several cases outlined below.
Steps to reproduce the behaviour: The steps below demonstrate that when you create a new title or edit it, the font always reverts to the default sans-serif except when you explicitly choose an alternate font. In other words, an alternate font must be specified every time the title is created or edited.
- In Inkscape create a title template using something other than the default sans-serif font. Save it as
~/.openshot_qt/title_templates/font-test.svg. - In OpenShot create new project and create a title using the
font-testtemplate. Just click on your template and click Save, leaving all values as they are. - Place it on a track and observe that the font is shown as the default sans-serif rather than what was saved in the template.
grep -oE "font-family:['a-zA-Z0-9 ]+" ~/.openshot_qt/title/TitleFileName*.svg- You will see whatever your system's default sans-serif font is, in my case I see,
font-family:'DejaVu Sans';twice. grep -oE "font-family:['a-zA-Z0-9 ]+" ~/.openshot_qt/title_templates/font-test.svgand you will see font-family is defined as what you set it to in Inkscape. In my case I seefont-family:C059twice.- Right-click on the title in Project Files -> Edit title -> Change Font -> set the font back to what was saved in Inkscape -> click Save.
- Confirm that the Video Preview shows the chosen font.
grep -oE "font-family:['a-zA-Z0-9 ]+" ~/.openshot_qt/title/TitleFileName*.svg- Confirm that you see the expected font name (not the default sans-serif).
- Right-click on the title in Project Files -> Edit title -> Change Font.
- Notice sans-serif is shown rather than the expected font.
- Click save and confirm that the title now displays in the default sans-serif in Video Preview.
- Right-click on the title in Project Files -> Edit title -> Change Font -> set the font back to what was saved in Inkscape -> click Save.
- Notice Video Preview again displays the expected font.
- Right-click on the title in Project Files -> Edit title -> Text Colour. Change text colour and save.
- Notice sans-serif is again shown rather than the expected font.
Expected behaviour: The font saved in the title template, as well as the font chosen, should remain set instead of reverting back to sans-serif.
System Details:
- OpenShot Version: 3.2.0
- libopenshot Version: 0.3.3
- Platform: Linux-6.9.7-arch1-1-x86_64-with-glibc2.39
- Processor: i3-1220P
- Machine: x86_64
- Python version: 3.12.4
- Qt5 version: 5.15.13
- PyQt5 version: 5.15.10
- Qt Detected Languages: ['en-GB', 'en-Latn-GB']
- LANG Environment Variable: en_GB.UTF-8
- LOCALE Environment Variable:
- Daily Build: Verified issue still exists in daily build: http://github.com/OpenShot/openshot-qt/releases/download/OpenShot-v3.2.0-dev-daily-12590-044bb224-23713d3a-x86_64.AppImage
Log Files: If you are experiencing a crash, please collect and attach logs of the problem. (it does not crash, but log is attached anyway)
Exception / Stacktrace: A message that might point to the issue that I saw when running the AppImage from the terminal was this:
Warning (in usvg::parser::svgtree:288): Failed to parse font-style value: 'Roman'.
Everything else was just INFO messages.
Thank you for your efforts.
This is a regression as it does not happen in the 3.1.1 Release, but it does happen with the 3.2.0 and 3.2.1 releases.
This looks like it's fixed with #5584 in 3.3.0 release.
Yes, it does appear to be fixed. I edited a slide and the font did not change. Very glad for this. :-)
On Mon, 2024-12-23 at 18:45 -0800, James Richards wrote:
This looks like it's fixed with #5584 [1] in 3.3.0 release. — Reply to this email directly, view it on GitHub [2], or unsubscribe [3]. You are receiving this because you authored the thread.Message ID: @.***>
[1] #5584 https://github.com/OpenShot/openshot-qt/pull/5584 [2] view it on GitHub https://github.com/OpenShot/openshot-qt/issues/5572#issuecomment-2560563747 [3] unsubscribe https://github.com/notifications/unsubscribe-auth/AETVFZDI2KECLISJBQRR2ET2HDDDFAVCNFSM6AAAAABKOR34IKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRQGU3DGNZUG4
That is great @babudro.