mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
font-patcher: Fail with meaningful message if font can not be opened
[why] When fontforge is not able to open the font we fail with a meaninless exception. Users might think that the font-patcher script itself is broken. [how] Exit the script with a hint how to get more information if fontforge was not able to open the font. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
f7d6fcb59c
commit
204a43aafb
1 changed files with 4 additions and 1 deletions
|
@ -51,7 +51,10 @@ class font_patcher:
|
|||
self.extension = ""
|
||||
self.setup_arguments()
|
||||
self.config = configparser.ConfigParser(empty_lines_in_values=False, allow_no_value=True)
|
||||
try:
|
||||
self.sourceFont = fontforge.open(self.args.font, ("fstypepermitted",))
|
||||
except Exception:
|
||||
sys.exit(projectName + ": Can not open font, try to open with fontforge interactively to get more information")
|
||||
self.setup_font_names()
|
||||
self.remove_ligatures()
|
||||
make_sure_path_exists(self.args.outputdir)
|
||||
|
|
Loading…
Reference in a new issue