def _loadBinary(self, path): for widget in self.topLevelWidgets(): if isinstance(widget, FontWindow): font = widget.font_() if font is not None and font.binaryPath == path: widget.raise_() return font = TFont() try: font.extract(path) self._loadFont(font) except Exception as e: errorReports.showCriticalException(e) return self.setCurrentFile(font.binaryPath)
def _loadUFO(self, path): for widget in self.topLevelWidgets(): if isinstance(widget, FontWindow): font = widget.font_() if font is not None and font.path == path: widget.raise_() return try: font = TFont(path) self._loadFont(font) except Exception as e: msg = self.tr("There was an issue opening the font at {}.").format(path) errorReports.showCriticalException(e, msg) return self.setCurrentFile(font.path)