Extracting glyph-path information from ttf files

≡放荡痞女 提交于 2019-12-05 02:50:31

Take a look at OpenType.js at http://opentype.js.org/

opentype.js provides you with raw access to the glyphs so you can modify them as you please.

One can inspect all the tables in an OpenType and TrueType font using Font Inspector, and enumerate all the glyphs using Glyph Inspector

This toolkit has an utility called ttf2svg, it is open source written in java. http://xmlgraphics.apache.org/batik/

You can try to extract the ttf parsing logic and implement it as you want.

In a past situation I used this utility to generate a svg file and use it in a web page targeting ipad users (@fontface css feature).

OpenType.js is perfect in a javascript environment, browser or Node.js (I contributed to the lib). Fast & easy to use. Just keep in mind that the implementation is not complete, if you need something that is not yet implemented you can open an issue and we will help you if we can!

For a more complete tool, fontTools will be more powerful in command line (& complete parsing/writing) https://github.com/behdad/fonttools/

If you do ttx myfont.ttf it will generate an xml file (myfont.ttx) with all infos, you can modify the infos and do ttx myfont.ttx and it will generate a font based on it!

By the way I did an awesome list for typography recently with a lot of resources concerning ttf / otf: https://github.com/Jolg42/awesome-typography
There are a lot of librairies in different languages from javascript to C 😉

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!