font-family css property value for text elements is not quoted

Bug #1545418 reported by Pavils Jurjans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned

Bug Description

Testing in Inkscape version 0.48

If a font is used that has spaces in its name, the font-family property in the resulting svg must be quoted, by specification (https://developer.mozilla.org/en/docs/Web/CSS/font-family)

While Inkscape itself recognizes its own svg, where the font names that are unquoted, there are other svg editors and renderers that will fail. I discovered this by inserting Inkscape-generated svg in Chrome.

This is how it currently builds the svg:

<tspan
         sodipodi:role="line"
         id="tspan2995"
         x="45.170155"
         y="211.50632"
         style="-inkscape-font-specification:Ubuntu Mono;font-family:Ubuntu Mono;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">ABC</tspan>

This is how it should build:

<tspan
         sodipodi:role="line"
         id="tspan2995"
         x="45.170155"
         y="211.50632"
         style="-inkscape-font-specification:'Ubuntu Mono';font-family:'Ubuntu Mono';font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">ABC</tspan>

Tags: css fonts svg
Revision history for this message
Pavils Jurjans (passiday) wrote :
Revision history for this message
jazzynico (jazzynico) wrote :

Thanks for taking the time to file a report!

It seems that the font-family attribute is correctly set with the latest stable Inkscape version (0.91).
Could you please update your Inkscape install?
I'm closing the report fixed, but don't hesitate to reopen if your still affected with Inkscape 0.91.

Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.91
status: New → Fix Released
Revision history for this message
Pavils Jurjans (passiday) wrote :

Added the PPA, installed 0.91, can confirm that the font-family attribute is now in single quotes, even when the font name is single word, because now ", Normal" is added to the font name:

style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:Dingbats;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"

Revision history for this message
jazzynico (jazzynico) wrote :

@Pavils - Thanks for reporting back, and glad it now works for you too!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.