mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
font-patcher: Abort if fontforge did not generate patched font
[why] Under certain circumjstances Fontforge can not create a font. As the API does not give any feedback we trudge along afterwards giving confusing messages. One example is when the patched font contains too many glyphs. [how] Check if the patched font has indeed been generated and is not empty. Fixes: #1342 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
75f785402d
commit
3053972f86
1 changed files with 3 additions and 0 deletions
|
@ -444,6 +444,9 @@ class font_patcher:
|
|||
|
||||
# Adjust flags that can not be changed via fontforge
|
||||
if re.search('\\.[ot]tf$', self.args.font, re.IGNORECASE) and re.search('\\.[ot]tf$', outfile, re.IGNORECASE):
|
||||
if not os.path.isfile(outfile) or os.path.getsize(outfile) < 1:
|
||||
logger.critical("Something went wrong and Fontforge did not generate the new font - look for messages above")
|
||||
sys.exit(1)
|
||||
try:
|
||||
source_font = TableHEADWriter(self.args.font)
|
||||
dest_font = TableHEADWriter(outfile)
|
||||
|
|
Loading…
Reference in a new issue