Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.15.15
-
None
Description
Overview
When an SVG has a font-family attribute set to a comma-delimited list of font families, the default font is used instead.
Analysis
Qt added a vector to hold the list of font families (in 5.13?) but the code for parsing the list was omitted. This breaks things when font-family is a comma delimited list was, since it takes the font-family attribute literally as the font name (complete with commas) which of course will never exist.
Attached is a sample SVG file, along with expected and actual rendered versions.
A solution
Also attached is a fix, as a diff/patch. Comments on the fix:
The original code to process the list is in qfontdatabse familyList. We've borrowed that code (and left the original code in place since it may still be needed) so the parsing should work the same as before. In particular, the parsing trims leading and trailing whitespace, and if an element is quoted (single or double quotes), the quotes are removed.
Related
See also
https://bugreports.qt.io/browse/QTBUG-81926
https://codereview.qt-project.org/c/qt/qtsvg/+/291101