FontWeight parsing is incorrect
I'm in the process of adding logging when we encounter parsing errors. I got one like this:
$ ./rsvg-convert -o foo.png tests/fixtures/reftests/bugs/587721-text-transform.svg
(style property error for attribute FontWeight
value="400"
error parsing value for attribute "font-weight": unexpected value
property will be ignored)
The property is defined as
make_property!(
ComputedValues,
FontWeight,
default: Normal,
inherits_automatically: true,
identifiers:
"normal" => Normal,
"bold" => Bold,
"bolder" => Bolder,
"lighter" => Lighter,
"100" => W100, // FIXME: we should use Weight(100),
"200" => W200, // but we need a smarter macro for that
"300" => W300,
"400" => W400,
// ... etc
);
But the implementation of identifiers:
in property_macros.rs
uses parser.expect_ident()
. This won't pick up numbers like the 400
above, unfortunately.
CC @pborelli do you think we need a custom parser for that property?