purplebamboo / font-carrier

font-carrier是一个功能强大的字体操作库,使用它你可以随心所欲的操作字体。让你可以在svg的维度改造字体的展现形状。
http://purplebamboo.github.io/font-carrier/
MIT License
1.61k stars 194 forks source link

Remove ascent #28

Closed joe223 closed 5 years ago

joe223 commented 5 years ago

Problem:

It will cause unexpected translate while using ascent:

image

https://github.com/purplebamboo/font-carrier/blob/06e0c197c676b1ba1d12e4bdf2eb0199dbdf6d8e/lib/class/glyph.js#L64

Resolve:

- path = svgpath(path).scale(1 / scale).translate(0, ascent).round(config.PATH_DECIMAL).toString()
+ path = svgpath(path).scale(1 / scale).translate(0, 0).round(config.PATH_DECIMAL).toString()

image

yisibl commented 5 years ago

PR welcome!

joe223 commented 5 years ago

@yisibl see you latter