![]() So I just converted my font into an XML file, used sed ttx converts a TTF font into an XML file, which was useful to meīecause I wanted to rename some glyphs in my font but did not understandĪnything about fonts. from fontTools.ttLib import TTFontįrom import addOpenTypeFeaturesĪddOpenTypeFeatures(ft_font, 'rules.fea', tables=)įontTools also provides a couple of command line tools called ttx andįonttools. Rules (in rules.fea) to the font file input.ttf. There’s a Python libraryĬalled fonttools, and these 5 lines of code will apply a list of OpenType ![]() how to apply these rules: fonttoolsĪdding new OpenType rules to a font is extremely easy. There are a lot of examples of cool things you can do in there, like replace “ffi” with a ligature. The best documentation I found for OpenType was this OpenType™ Feature File Specification reference. OpenType reference documentation: awesome Random the way handwriting is, but it does introduce a little bit of variation. So this means I can make ab appear different from ac in the font. What sub a' b by other_a means is: If an a glyph is before a b, then replace the a with the glyph other_a. ![]() Here’s an example rule: sub a' b by other_a Learned that you can write extremely simple OpenType rules to change how aįont looks, and you don’t even have to really understand anything about fonts. I started out being extremely confused about what OpenType even is. The main idea: OpenType lets you replace characters based on context
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |