aboutsummaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFelipe Corrêa da Silva Sanches2015-09-23 22:45:30 -0300
committerFelipe Corrêa da Silva Sanches2015-09-23 22:45:30 -0300
commit999ae751a4f661c85ace554a8eb3feff793eebc7 (patch)
tree73237818364d6dbff980967c1bd391ef395237d7 /Lib
parent32237e7f76ff9ea43123524834d8b0ad319c7b5c (diff)
downloadtrufont-999ae751a4f661c85ace554a8eb3feff793eebc7.tar.bz2
closes #5: Removes hardcoded C:\\CharterNova-Regular.ufo and uses one of our sample UFO files. File paths are (if everything's correct) handled in a crossplatform manner.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/defconQt/__main__.py13
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_())