And yeah, only thing left now almost is that I want to be able to manipulate where it builds the f and y charaters. With above script I am able to create a new ligature f_y and build its components to it and see it in the metrics, then generate an otf font from it using the fontforge GUI. #font.generate('ant1.otf', flags='opentype')įont.generate('ant1.otf', flags=('opentype',)) # Doing it glyph.unlinkRef('f_y') it says "OSError: No reference named f_y found in glyph f_y # below unlinking doesn't work, outputs nothing and stays linked However, a request to add a feature to it that's not in Python must add it to Python as well to be accepted.Įverything possible in the GUI, within reason, should also be possible in Python, so it's also usually not acceptable to add a feature only to the GUI.īeta Was this translation helpful? Give feedback.įont.addLookup('ligatures','gsub_ligature', (),]]]])įont.addLookupSubtable('ligatures', 'ligatureshi') There are no plans to remove the legacy language, and we of course still accept pull requests fixing issues in it and bringing it up to parity with Python. It is allowed, as of at least PR №4154, to implement a feature in the Python API and not backport it to the legacy language. FontForge's Python API is always to be used for new scripts. We recommend no new scripts in the legacy language be written. Per §D2 (emphasis mine):įontForge includes two scripting capabilities: first, via a legacy scripting language created by George Williams, FontForge's original author, called internally ff. If you're going to be learning scripting in FontForge, it's non-intuitive to start with the native scripting language. Anyway if the function font.addLookup() and font.addLookupSubtable() are supposed to add new tables then the names shouldn't match anyway right?Īnyway this is what the file may look after simplifying: Then I opened fontforge and try edit the fonts lookup table and subtable names for ligatures to "liga" and generate the font again, there is something going on, because then after I open the newly generated font, the old default name 'liga' Standard Ligatures in Latin lookup 1 subtable is back (and not the simple "liga" that I edited there. Then I created the above mentioned script but modified the names in it to "liga" both. Then I installed it and tested it, and my newly created ligature worked. It allowed me to still generate the font and I did. It also found errors: self intersecting, missing points at extrema, too many points. I continued to generate the font, generated as an otf font. Generated a font file, at which point it didn't like the em size was 1300 and that it should be 1000. ![]() Then I just used the method for adding ligatures described in this tutorial and adde one ligature for a_b. I downloaded just some test font that already has ligatures and it was this Here's the process trying to add just this one ligature using scripting: Glyph.addPosSub('ligatureshi', ligature_tuple) Glyph = font.createChar(-1, ligature_name) Font.AddLookup('ligatures','gsub_ligature', (),]]]])įont.AddLookupSubtable('ligatures', 'ligatureshi')
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |