diff options
Diffstat (limited to 'Lib/defconQt/__main__.py')
| -rw-r--r-- | Lib/defconQt/__main__.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/defconQt/__main__.py b/Lib/defconQt/__main__.py index c1e548c..8678906 100644 --- a/Lib/defconQt/__main__.py +++ b/Lib/defconQt/__main__.py @@ -1,16 +1,19 @@ from defconQt.objects.defcon import TFont from defconQt.fontView import MainWindow import sys +import os from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication if len(sys.argv) < 2: - ufoFile = "C:\\CharterNova-Regular.ufo" -# print('Usage: %s INPUTFILE' % sys.argv[0]) -# sys.exit(1) + share_dir = os.path.join(os.path.dirname(__file__), '..', '..', 'share') + ufoFile = os.path.join(share_dir, 'fonts', 'subsets', 'Merriweather-Bold-Subset-nop.ufo') + print ('Usage: %s <input.ufo>' % sys.argv[0]) + print ('Loading default sample font: "%s"' % ufoFile) else: - ufoFile = sys.argv[1] + ufoFile = sys.argv[1] + print('Loading font file: "%s"' % ufoFile) #from pycallgraph import PyCallGraph #from pycallgraph.output import GraphvizOutput @@ -20,6 +23,6 @@ representationFactories.registerAllFactories() app = QApplication(sys.argv) # TODO: http://stackoverflow.com/a/21330349/2037879 app.setWindowIcon(QIcon("defconQt/resources/icon.png")) -window = MainWindow(TFont(ufoFile)) +window = MainWindow(TFont(os.path.abspath(ufoFile))) window.show() sys.exit(app.exec_()) |
