font-family parsing is incorrect
With the logging code I'm adding, I get this:
(style property error for attribute FontFamily
value="Verdana"
error parsing value for attribute "font-family": expected number
property will be ignored)
This is from
<g font-family="Verdana" font-size="75"
font-weight="bold" fill="url(#MyGradient)" >
And another one:
(style property error for attribute FontFamily
value="Bitstream Vera Sans"
error parsing value for attribute "font-family": expected number
property will be ignored)
This is from the very long style
attribute here:
<path inkscape:connector-curvature='0' d='m 49.7795,452.00772 c -0.17789,0.0489 -0.3419,0.14728 -0.46875,0.28125 l -3.03125,3 c -0.2353,0.23073 -0.34458,0.58283 -0.28125,0.90625 l 0,0.8125 0.8125,0 0.1875,0 1.4707,0 -1.1875,1.27358 c -0.21461,0.21931 -0.32135,0.53954 -0.28125,0.84375 -10e-4,0.0312 -10e-4,0.0625 0,0.0937 l 0,0.78125 0.84375,0 0.15625,0 c 0.26386,0.004 0.52791,-0.099 0.71875,-0.28125 l 3,-2.99234 c 0.18369,-0.18976 0.28735,-0.45466 0.28125,-0.71869 0.003,-0.0416 0.003,-0.0834 0,-0.125 l 0,-0.875 -0.84375,0 -0.15625,0 -1.56445,0 1.3125,-1.28125 c 0.21461,-0.21931 0.32135,-0.53954 0.28125,-0.84375 0.001,-0.0312 0.001,-0.0625 0,-0.0937 l 0,-0.78129 -0.84375,0 -0.0937,0 c -0.0208,-6.5e-4 -0.0417,-6.5e-4 -0.0625,0 -0.0829,-0.0103 -0.16709,-0.0103 -0.25,0 z' id='path5600'
sodipodi:nodetypes='ccccccccccccccccccccccccccccccc'
style='font-size:xx-small;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/>
Unless the family name corresponds to a CSS IDENT, it must be quoted.
And from the CSS spec:
Font family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the font name are ignored and any sequence of whitespace characters inside the font name is converted to a single space.
We aren't processing unquoted strings correctly; we just throw the value into parser.expect_string()
, which fails because it expects quotes.
Also, note the expected number
in the logged message; this is a copy-and-paste error from impl Parse for String
.