Skip to content

anthrotype/python-modules

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python modules

These files are used and required by some of the Python scripts available in the other repositories.

For FontLab scripts, put these files in [...]/FontLab/Studio 5/Macros/System/Modules. For the remaining scripts, put these files in the same folder as the script, or put them in one of the folders listed by sys.path.


Example code for WriteFeaturesKernFDK in RoboFont scripting window:


import os
import WriteFeaturesKernFDK

f = CurrentFont()

minKern = 5
writeTrimmed = False
writeSubtables = False

instanceFolder = os.path.dirname(f.path)

WriteFeaturesKernFDK.KernDataClass(f, instanceFolder, minKern, writeTrimmed, writeSubtables)


Example code for a Python file that uses WriteFeaturesKernFDK from the command line:


import sys
import os
from defcon import Font
import WriteFeaturesKernFDK

ufo = sys.argv[-1]
if ufo.endswith(os.sep):
    ufo = ufo[:-1]
f = Font(ufo)

minKern = 3
writeTrimmed = False
writeSubtables = True

instanceFolder = os.path.dirname(f.path)

WriteFeaturesKernFDK.KernDataClass(f, instanceFolder, minKern, writeTrimmed, writeSubtables)

About

Python modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published