Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ExportClassKerningToUFO.py, which mirrors FontLab Class kerning into a UFO file.
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "Modules"] | ||
path = Modules | ||
url = https://github.com/adobe-type-tools/python-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#FLM: Export FontLab class kerning to UFO | ||
import os | ||
moduleFound = False | ||
|
||
try: | ||
from kernExport import * | ||
reload(kernExport) | ||
moduleFound = True | ||
|
||
except ImportError: | ||
modulePath = os.path.join(fl.userpath, 'Macros', 'System', 'Modules') | ||
url = 'https://github.com/adobe-type-tools/python-modules' | ||
print ''' | ||
Please make sure you have placed the "kernExport.py" module in your Macros/System/Modules folder: | ||
%s | ||
Get the module here: | ||
%s | ||
''' % (modulePath, url) | ||
|
||
|
||
if moduleFound: | ||
|
||
# three options are possible; for further details see kernExport.__doc__: | ||
# kernExport.ClassKerningToUFO(fl.font, prefixOption = 'MM') # prefix kerning classes in MetricsMachine-style | ||
# kernExport.ClassKerningToUFO(fl.font, prefixOption = 'UFO3') # prefix kerning classes in UFO3-style | ||
# kernExport.ClassKerningToUFO(fl.font) # do not change the name of kerning classes (apart from side markers) | ||
|
||
kernExport.ClassKerningToUFO(fl.font, 'MM') |