You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When input SVG file refers to a font with a space in its name (e.g. "Cascadia Code"), calling svg2rlg results in Unable to find a suitable font for 'font-family:Cascadia Code', weight:normal, style:normal warning messages and the default font is used instead.
Specifically, what happens is that when the font name has a space in its name, convertFontFamily method of Svg2RlgAttributeConverter class located in svglib.py splits the input font name into multiple strings using space character as a delimiter (line 406), and then feeds these split strings into find_font method of FontMap class located in fonts.py, resulting in all calls to find_font failing (because it gets "Cascadia" and "Code" as separate inputs during two separate calls).
There are plenty of fonts with a space character in their name, even in standard Windows distribution, so using space character as a separator is not warranted and breaks the functionality.
The text was updated successfully, but these errors were encountered:
When input SVG file refers to a font with a space in its name (e.g. "Cascadia Code"), calling svg2rlg results in
Unable to find a suitable font for 'font-family:Cascadia Code', weight:normal, style:normal
warning messages and the default font is used instead.Specifically, what happens is that when the font name has a space in its name, convertFontFamily method of Svg2RlgAttributeConverter class located in svglib.py splits the input font name into multiple strings using space character as a delimiter (line 406), and then feeds these split strings into find_font method of FontMap class located in fonts.py, resulting in all calls to find_font failing (because it gets "Cascadia" and "Code" as separate inputs during two separate calls).
There are plenty of fonts with a space character in their name, even in standard Windows distribution, so using space character as a separator is not warranted and breaks the functionality.
The text was updated successfully, but these errors were encountered: