aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt/__main__.py
blob: b8feaf210fe3b0329da54aec6d8244f6f86fce86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from defconQt.objects.defcon import TFont
from defconQt.fontView import Application, MainWindow
import sys
import os
from PyQt5.QtGui import QIcon

if len(sys.argv) < 2:
    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]
    print('Loading font file: "%s"' % ufoFile)

#from pycallgraph import PyCallGraph
#from pycallgraph.output import GraphvizOutput
from defconQt import representationFactories
representationFactories.registerAllFactories()
#with PyCallGraph(output=GraphvizOutput()):
app = Application(sys.argv)
# TODO: http://stackoverflow.com/a/21330349/2037879
app.setOrganizationName("A. Tétar & Co.")
app.setApplicationName("defconQt")
app.setWindowIcon(QIcon("defconQt/resources/icon.png"))
window = MainWindow(TFont(os.path.abspath(ufoFile)))
window.show()
sys.exit(app.exec_())