aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/defconQt/fontView.py24
-rw-r--r--README.md5
2 files changed, 29 insertions, 0 deletions
diff --git a/Lib/defconQt/fontView.py b/Lib/defconQt/fontView.py
index 80aabec..38cc054 100644
--- a/Lib/defconQt/fontView.py
+++ b/Lib/defconQt/fontView.py
@@ -574,6 +574,7 @@ class MainWindow(QMainWindow):
fileMenu.addSeparator()
fileMenu.addAction("&Save", self.saveFile, QKeySequence.Save)
fileMenu.addAction("Save &as…", self.saveFileAs, QKeySequence.SaveAs)
+ fileMenu.addAction("Export…", self.export)
fileMenu.addAction("Reload from disk", self.reload)
fileMenu.addAction("E&xit", self.close, QKeySequence.Quit)
menuBar.addMenu(fileMenu)
@@ -717,6 +718,29 @@ class MainWindow(QMainWindow):
self.setWindowTitle()
#return ok
+ def export(self):
+ try:
+ from ufo2fdk import haveFDK, OTFCompiler
+ except Exception as e:
+ errorMessage = QErrorMessage(self)
+ errorMessage.showMessage(e)
+ return
+ if not haveFDK():
+ errorMessage = QErrorMessage(self)
+ errorMessage.showMessage("The Adobe FDK could not be found.")
+ return
+
+ path, ok = QFileDialog.getSaveFileName(self, "Save File", None,
+ "PS OpenType font (*.otf)")
+ if ok:
+ compiler = OTFCompiler()
+ # XXX: allow choosing parameters
+ reports = compiler.compile(self.font, path, checkOutlines=False,
+ autohint=True, releaseMode=True)
+
+ print(reports["autohint"])
+ print(reports["makeotf"])
+
def setCurrentFile(self, path):
settings = QSettings()
recentFiles = settings.value("core/recentFiles", [], type=str)
diff --git a/README.md b/README.md
index ebc9068..aef3970 100644
--- a/README.md
+++ b/README.md
@@ -10,9 +10,14 @@ Dependencies:
- [Adrien Tétar’s fork of robofab, python3-ufo3 branch]
- [Lasse Fister’s fork of defcon, serialization-py3-ufo-3 branch]
+Optional:
+
+- [Adrien Tétar’s fork of ufo2fdk, python3-ufo3 branch]
+
[Behdad Esfahbod’s fontTools]: https://github.com/behdad/fonttools
[Adrien Tétar’s fork of robofab, python3-ufo3 branch]: https://github.com/adrientetar/robofab
[Lasse Fister’s fork of defcon, serialization-py3-ufo-3 branch]: https://github.com/graphicore/defcon/tree/serialization-py3-ufo-3
+[Adrien Tétar’s fork of ufo2fdk, python3-ufo3 branch]: https://github.com/adrientetar/ufo2fdk
Run: