Hi there,
I've been attempting with no much success to remove only
vertical PS hints with a script but I can't go further than printing them. I found the
RemoveHints(integer mode) method in the old Fontlab Python reference but I can't find a way to use it.Can anyone give a hand with it?
TIA.
from robofab.world import AllFonts
for font in AllFonts():
for x in font:
for n in x.naked().vhints:
print n
print 'Ready'
font.update()
Comments
if x.name in diacritics: x.naked().vhints.clean() print "Vertical hints removed in %s" % x.name x.update()
(nitpicking but) you can do better than that: since you have the list of glyph names you care about, you don't need to loop through all glyphs in the font:
for font in AllFonts():
for n in diacritics:
if n not in font: continue
glyph = font[n]
# do things with the glyph
*Actually looking at the code I noticed an unnecessary conversion to a list so I put up a PR to change that.
(Of course this all doesn't matter very much until you have large datasets.)