diff options
| author | Adrien Tétar | 2015-05-30 21:12:30 +0200 | 
|---|---|---|
| committer | Adrien Tétar | 2015-05-30 21:15:51 +0200 | 
| commit | 0a37e9204d91ea50059c1320f9375730b79a557c (patch) | |
| tree | ef3945410098ef70b0f7d856191b280fb2d922bd | |
| parent | 3d769d86cc997486cea888f47310b546d112151e (diff) | |
| download | trufont-0a37e9204d91ea50059c1320f9375730b79a557c.tar.bz2 | |
Fix a few things
| -rw-r--r-- | Lib/defconQt/featureTextEditor.py | 15 | ||||
| -rw-r--r-- | Lib/defconQt/fontView.py | 11 | ||||
| -rw-r--r-- | Lib/defconQt/spacecenter.py | 2 | ||||
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | setup.py | 8 | 
5 files changed, 26 insertions, 22 deletions
| diff --git a/Lib/defconQt/featureTextEditor.py b/Lib/defconQt/featureTextEditor.py index 079a2c4..0786c03 100644 --- a/Lib/defconQt/featureTextEditor.py +++ b/Lib/defconQt/featureTextEditor.py @@ -64,10 +64,9 @@ class LineNumberArea(QWidget):  class TextEditor(QPlainTextEdit):      def __init__(self, text=None, parent=None):          super(TextEditor, self).__init__(parent) -        font = QFont() -        font.setFamily('Roboto Mono') -        font.setPointSize(10) -        font.setFixedPitch(True) +        # https://gist.github.com/murphyrandle/2921575 +        font = QFont('Roboto Mono', 10) +        #font.setFixedPitch(True)          self._indent = "    "          self.highlighter = Highlighter(self.document()) @@ -78,11 +77,9 @@ class TextEditor(QPlainTextEdit):          self.setPlainText(text)          self.setFont(font) -    def setFontParams(self, family='CamingoCode', ptSize=10, isMono=True): -        font = QFont() -        font.setFamily(family) -        font.setPointSize(ptSize) -        font.setFixedPitch(isMono) +    def setFontParams(self, family='Roboto Mono', ptSize=10, isMono=True): +        font = QFont(family, ptSize) +        #font.setFixedPitch(isMono)          self.setFont(font)      def write(self, features): diff --git a/Lib/defconQt/fontView.py b/Lib/defconQt/fontView.py index e5b6522..6168ffd 100644 --- a/Lib/defconQt/fontView.py +++ b/Lib/defconQt/fontView.py @@ -516,6 +516,13 @@ class MainWindow(QMainWindow):  if __name__ == '__main__':      import sys +    if len(sys.argv) < 2: +         ufoFile = "C:\\CharterNova-Regular.ufo" +#        print('Usage: %s INPUTFILE' % sys.argv[0]) +#        sys.exit(1) +    else: +         ufoFile = sys.argv[1] +      #from pycallgraph import PyCallGraph      #from pycallgraph.output import GraphvizOutput @@ -523,8 +530,8 @@ if __name__ == '__main__':      #with PyCallGraph(output=GraphvizOutput()):      app = QApplication(sys.argv)      # TODO: http://stackoverflow.com/a/21330349/2037879 -    app.setWindowIcon(QIcon("C:\\Users\\Adrien\\Downloads\\defconQt\\Lib\\defconQt\\resources\\icon.png")) -    window = MainWindow(Font("C:\\CharterNova-Regular.ufo")) +    app.setWindowIcon(QIcon("resources/icon.png")) +    window = MainWindow(Font(ufoFile))      window.resize(605, 430)      window.show()      sys.exit(app.exec_()) diff --git a/Lib/defconQt/spacecenter.py b/Lib/defconQt/spacecenter.py index 5aa755f..8b323c2 100644 --- a/Lib/defconQt/spacecenter.py +++ b/Lib/defconQt/spacecenter.py @@ -167,7 +167,7 @@ class FontToolBar(QToolBar):          self.configBar = QPushButton(self)          self.configBar.setFlat(True) -        self.configBar.setIcon(QIcon("C:\\Users\\Adrien\\Downloads\\defconQt\\Lib\\defconQt\\resources\\ic_settings_24px.svg")) +        self.configBar.setIcon(QIcon("resources/ic_settings_24px.svg"))          self.configBar.setStyleSheet("padding: 2px 0px; padding-right: 10px");          self.toolsMenu = QMenu(self)          wrapLines = self.toolsMenu.addAction("Wrap lines", self.wrapLines) @@ -4,13 +4,13 @@  Dependencies: -- [Behdad Esfahbod’s fontTools] -- [Adrien Tétar’s fork of robofab, python3 branch] -- [Adrien Tétar’s fork of defcon, python3 branch] +- [Behdad Esfahbod’s fontTools] +- [Adrien Tétar’s fork of robofab, python3 branch] +- [Adrien Tétar’s fork of defcon, python3 branch] -[Behdad Esfahbod’s fontTools]: https://github.com/behdad/fonttools -[Adrien Tétar’s fork of robofab, python3 branch]: https://github.com/adrientetar/robofab -[Adrien Tétar’s fork of defcon, python3 branch]: https://github.com/adrientetar/defcon +[Behdad Esfahbod’s fontTools]: https://github.com/behdad/fonttools +[Adrien Tétar’s fork of robofab, python3 branch]: https://github.com/adrientetar/robofab +[Adrien Tétar’s fork of defcon, python3 branch]: https://github.com/adrientetar/defcon  Run: @@ -6,14 +6,14 @@ from distutils.core import setup  try:      import fontTools  except: -    print "*** Warning: defcon requires FontTools, see:" -    print "    fonttools.sf.net" +    print("*** Warning: defcon requires FontTools, see:") +    print("    fonttools.sf.net")  try:      import robofab  except: -    print "*** Warning: defcon requires RoboFab, see:" -    print "    robofab.com" +    print("*** Warning: defcon requires RoboFab, see:") +    print("    robofab.com")  #if "sdist" in sys.argv:  #    import os | 
