SVG Font's descent does not import properly. It will assign the ascent to 0.8 of the units-per-em and the descent to 0.2 of the units-per-em.
That comes from lines 3253 and 3254 of svg.c in the SVGParseFont function. (val is the units-per-em)
sf->ascent = val*800/1000;
sf->descent = val - sf->ascent;
Later in the function (lines 3385-3388) the ascent and descent from the svg are grabbed as ascent and descent. The program seems to assume that descent is negative, as seen in this if statement.
if ( ascent-descent==sf->ascent+sf->descent ) {
sf->ascent = ascent;
sf->descent = -descent;
}
In the SVG Font Documentation the examples show positive descent values. So this behavior contradicts the SVG standard making it impossible to specify the ascent and descent in, for example, Inkscape's SVG Font Editor where it will only accept positive values for descent. In order to get desired behavior you must manually edit the svg to set the value to negative.
To fix this replace the - with + and remove the - from the assign
if ( ascent+descent==sf->ascent+sf->descent ) {
sf->ascent = ascent;
sf->descent = descent;
}
These variables are not referenced anywhere else so the change would have no impact on other code.
SVG Font's descent does not import properly. It will assign the ascent to 0.8 of the units-per-em and the descent to 0.2 of the units-per-em.
That comes from lines 3253 and 3254 of svg.c in the SVGParseFont function. (val is the units-per-em)
Later in the function (lines 3385-3388) the ascent and descent from the svg are grabbed as ascent and descent. The program seems to assume that descent is negative, as seen in this if statement.
In the SVG Font Documentation the examples show positive descent values. So this behavior contradicts the SVG standard making it impossible to specify the ascent and descent in, for example, Inkscape's SVG Font Editor where it will only accept positive values for descent. In order to get desired behavior you must manually edit the svg to set the value to negative.
To fix this replace the - with + and remove the - from the assign
These variables are not referenced anywhere else so the change would have no impact on other code.