diff options
| author | Adrien Tétar | 2015-11-03 21:03:03 +0100 |
|---|---|---|
| committer | Adrien Tétar | 2015-11-03 21:03:03 +0100 |
| commit | e9da3091d080ed1b3d2653bb7e581d6a4fe87b81 (patch) | |
| tree | 4f24848563d200a56791230bc2362a3d3a2d14f2 /Lib | |
| parent | b39327b9711d92ac006189bf6421329a1a8d8d07 (diff) | |
| download | trufont-e9da3091d080ed1b3d2653bb7e581d6a4fe87b81.tar.bz2 | |
fontView: allow pfb as well, fix path API misuse
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/defconQt/fontView.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Lib/defconQt/fontView.py b/Lib/defconQt/fontView.py index db1979e..0aa8c85 100644 --- a/Lib/defconQt/fontView.py +++ b/Lib/defconQt/fontView.py @@ -766,11 +766,11 @@ class MainWindow(QMainWindow): def openFile(self, path=None, stickToSelf=False): if not path: - path, ok = QFileDialog.getOpenFileName( + path, _ = QFileDialog.getOpenFileName( self, "Open File", '', platformSpecific.fileFormats ) - if not ok: + if not path: return if path: if ".plist" in path: @@ -843,14 +843,17 @@ class MainWindow(QMainWindow): # TODO: systematize this into extractor fileFormats = ( "OpenType Font file (*.otf *.ttf)", - "Type1 Font file (*.pfa)", + "Type1 Font file (*.pfa *.pfb)", "ttx Font file (*.ttx)", "WOFF Font file (*.woff)", + "All supported files (*.otf *.pfa *.pfb *.ttf *.ttx *.woff)", + "All files (*.*)", ) - path, ok = QFileDialog.getOpenFileName(self, "Import File", None, - ";;".join(fileFormats)) - if ok: + path, _ = QFileDialog.getOpenFileName( + self, "Import File", None, ";;".join(fileFormats), fileFormats[4]) + + if path: font = TFont() try: extractor.extractUFO(path, font) @@ -873,9 +876,9 @@ class MainWindow(QMainWindow): "could not be found.") return - path, ok = QFileDialog.getSaveFileName(self, "Export File", None, - "PS OpenType font (*.otf)") - if ok: + path, _ = QFileDialog.getSaveFileName(self, "Export File", None, + "OpenType PS font (*.otf)") + if path: compiler = OTFCompiler() # XXX: allow choosing parameters reports = compiler.compile(self.font, path, checkOutlines=False, |
