Skip to content

Commit

Permalink
Update for Glyphs 3 and Python 3 (Fix hagenburger#1)
Browse files Browse the repository at this point in the history
…but keep compatibility with Glyphs 2 and Python 2
  • Loading branch information
mekkablue authored Dec 18, 2021
1 parent ccedcfe commit 35e5dbf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Export-and-install.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#MenuTitle: Export and install font
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Exports and installs all active instances of this font and avoids caching.
"""
Expand All @@ -18,11 +19,11 @@
oldFonts = [f for f in os.listdir(installFolder) if re.match(filePattern, f)]
for oldFont in oldFonts:
os.remove(installFolder + "/" + oldFont)
print "Uninstalled %s" % oldFont
print("Uninstalled %s" % oldFont)
fileName = "%s-%s.otf" % (instance.fontName, suffix)
print "Exporting %s" % fileName
print("Exporting %s" % fileName)
instance.generate(FontPath = installFolder + "/" + fileName)
except Exception, e:
print e
print "Exported and installed %s" % font.familyName
except Exception as e:
print(e)
print("Exported and installed %s" % font.familyName)
Glyphs.showNotification("Export and install fonts", "Exported and installed %s" % font.familyName)

0 comments on commit 35e5dbf

Please sign in to comment.