


The is an iterator that return the glyphs that exist in the font from the selection. The first line adds an encoding slot with no Unicode number the second creates a glyph already present in the encoding. To store temporary or persistent data in a glyph (anything that can be pickled): font.temporary = įont.persistent = To test if a glyph is in the font, you can use: if "X" in font:
Fontforge rotate selection how to#
I assume you all know how to open a terminal, run a python script or can figure it out. I am running Linux so none of this is an issue for me, but I believe I read somewhere that you might need to check a box in the installer to enable python support. Type code directly in File|Execute script There are three ways to use python scripting in FontForge:Ĭalling fontforge -script script.py lets you run the script "script.py" that is in your current directory through FontForge.Īdd import fontforge at the beginning of your script to use FontForge as a library The first is legacy and it is less expressive anyway, so we will be using python. In the last part, I use scripts to redo the Tic-tac-toe font from Part#9, then adapt it to the game of Go.Īs explained here, FontForge supports two scripting languages. What I did is read the documentation, do some test, and select the functions that seemed important for you. This tutorial assumes that you have a good grasp of the Python programming language. Part#10 - FontForge Scripting In this tutorial, I show you how to use python scripting to manipulate glyphs, generate ligatures, create lookups, add anchors.
