Open davelab6 opened 9 years ago
This script you can throw sfd and ufo at:
from ufo2fdk import OTFCompiler
from robofab.world import OpenFont
import sys
if len(sys.argv)>1:
array = []
for f in sys.argv[1:]:
if ".sfd" in f:
import fontforge
font = fontforge.open(f)
for glyph in font.glyphs():
glyph.layers[1] = glyph.layers[1].removeOverlap().reverseDirection()
name = font.fullname + ".ufo"
font.generate(name, flags="round")
array.append(name)
else: array.append(f)
for f in array:
font = OpenFont(f)
compiler = OTFCompiler()
reports = compiler.compile(font, font.info.familyName + "-" + font.info.styleName + ".otf", checkOutlines=False, autohint=True, releaseMode=True)
print reports["autohint"]
print reports["makeotf"]
But removeOverlap() does not seem to work, it only adds points at intersections.
removeOverlap() does not seem to work
@frank-trampe sounds like this is now for you ;)
But removeOverlap() does not seem to work, it only adds points at intersections.
So it was not working because of mixed winding orders...
Is there a way to check for this situation and alert the user? Or is there no way to check for that situation?
This script you can throw sfd and ufo at:
I suggest to check your latest version in, such that I or someone else can add GUI hooks, so there will be a Tools menu item "Generate with AFDKO" that allows us to generate a OTF/TTF from the current font via UFO and FDK.
Is there a way to check for this situation and alert the user?
Not that I know of.
Edit: there is contour.isClockwise() w Python scripting.
@pathumego was this script useful for you?
I'll add a UFO export python script and bundle it with the next release, "Export UFO for AFDKO", that runs
Or maybe @adrientetar will update the export window to add a checkbox similar to the one for choosing kerning (as export checkboxes retain a users' settings)