Closed nfroidure closed 10 years ago
Looks that patch should be improved. Please, post test sample, and what is wrong with it.
@puzrin i taken your comments in count
About tests, any SVG font with a null descent value will do the job, your an create one here : http://nfroidure.github.io/svgiconfont/. I could have add tests for the issue but it seems nothing is tested for now and i don't think it's my role to choose witch test framework should be used.
@nfroidure i have no time to play with your app, sorry. Just post minimalistic SVG sample here as text. Tests not needed.
@puzrin here it is.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<font id="iconfont" horiz-adv-x="150">
<font-face font-family="iconfont"
units-per-em="150" ascent="150"
descent="0" />
<missing-glyph horiz-adv-x="0" />
<glyph glyph-name="arrow-down"
unicode=""
horiz-adv-x="150" d=" M75 30L120 80L30 80z" />
<glyph glyph-name="arrow-right"
unicode=""
horiz-adv-x="150" d=" M100 75L50 120L50 30z" />
<glyph glyph-name="arrow-up"
unicode=""
horiz-adv-x="150" d=" M75 80L120 30L30 30z" />
</font>
</defs>
</svg>
By ttfing it you'll notice a y decal corresponding to the fact the ascent is change from 0 to -150
here goes the rollback
By ttfing it you'll notice a y decal corresponding to the fact the ascent is change from 0 to -150
What do you mean ? Don't understand you
Ah, ok. Can you rebase (squash all commits into one) ?
svg2ttf my-svg.svg font.tff
When using font.ttf, glyphs aren't well positioned.
They are upper than expected.
It is due to the fact that the ascent value of 0 is replaced by the -150 value.
I had problem with generating ttf fonts from svg font that had a descent attribute value set to 0. It is legal to have a descent velue equal to 0.