SOLVED how to save RKerning and RGroups to fea file?
-
Hey,
Is there a simple way to save kerning objects to fea code with the script?
I cannot find any option online. I've been trying to do it with fontTools but I had no success
Best
R
-
look also at ufo2ft
-
Love it @connor , Thanks!!!
-
@RafaŁ-Buchner Here is a method using ufo2fdk.
from ufo2fdk.kernFeatureWriter import KernFeatureWriter for font in AllFonts(): path = font.path kernPath = path.replace(".ufo"," kern.fea") w = KernFeatureWriter(font) output = w.write() k = open(kernPath, 'w') k.write(output) k.close() print("exporting %s %s kerning feature" % (font.info.familyName, font.info.styleName))
-
@connor said in how to save RKerning and RGroups to fea file?:
fonts = metricsMachine.AllFonts()
for f in fonts:
kernPath = f.path.replace(".ufo"," kern.fea")
f.kerning.exportFeatureText(kernPath, insertSubtableBreaks=False)
print("exporting %s %s kerning feature" % (f.info.familyName, f.info.styleName))Thanks @connor, it should work for now. Nonetheless, I would rather use some stuff that would run independently from other extensions. Default RF's libraries only.
-
If you use the MM scripting API you can do:
fonts = metricsMachine.AllFonts() for f in fonts: kernPath = f.path.replace(".ufo"," kern.fea") f.kerning.exportFeatureText(kernPath, insertSubtableBreaks=False) print("exporting %s %s kerning feature" % (f.info.familyName, f.info.styleName))