Open madig opened 6 years ago
I got this far on automated removal of this glif file library key across all source files and need some guidance on an appropriate pointPen to use in order to capture the contours for the write back to the *.glif source. Thoughts?
from ufoLib import UFOReader
class GlyphObj(object):
def __init__(self):
pass
ufo = UFOReader("Test-Regular.ufo")
glyphset = ufo.getGlyphSet()
for glyphname in glyphset.contents:
gobj = GlyphObj()
glyph = glyphset.readGlyph(glyphname, gobj, POINTPEN) # <--- HERE
if hasattr(gobj, "lib"):
gobj.lib.pop("com.schriftgestaltung.Glyphs.lastChange", None)
glyphset.writeGlyph(glyphname, gobj, POINTPEN) # <--- AND HERE
And by the following comment:
inserting the
com.schriftgestaltung.customParameter.GSFont.lastChange
lib key.
what do you set this key to in order to eliminate Glyphs app time stamps of the *.glif files?
Try
from pathlib import Path
import defcon
for ufo in Path("src").glob("*.ufo"):
u = defcon.Font(ufo)
u.lib["com.schriftgestaltung.customParameter.GSFont.lastChange"] = False
for layer in u.layers:
for glyph in layer:
if "com.schriftgestaltung.Glyphs.lastChange" in glyph.lib:
del glyph.lib["com.schriftgestaltung.Glyphs.lastChange"]
Thank you!
Round-trip through Glyphs.app to make sure stuff doesn't sneak back in.
These are just noise if you're using Git. You can keep Glyphs from inserting them by setting the "Disable Last Change" parameter in the font or inserting the
com.schriftgestaltung.customParameter.GSFont.lastChange
lib key.