diff --git a/font-patcher b/font-patcher index 4cbf46cfc..84ae5a164 100755 --- a/font-patcher +++ b/font-patcher @@ -6,7 +6,7 @@ from __future__ import absolute_import, print_function, unicode_literals # Change the script version when you edit this script: -script_version = "4.8.2" +script_version = "4.8.3" version = "3.1.1" projectName = "Nerd Fonts" @@ -1212,7 +1212,7 @@ class font_patcher: 'height': self.sourceFont.descent + self.sourceFont.ascent, } our_btb = self.sourceFont.descent + self.sourceFont.ascent - elif self.font_dim['height'] < 0: + if self.font_dim['height'] <= 0: logger.critical("Can not detect sane font height") sys.exit(1) @@ -1266,6 +1266,9 @@ class font_patcher: if self.font_dim['width'] < self.font_dim['xmax']: logger.debug("Font has negative right side bearing in extended glyphs") self.font_dim['xmax'] = self.font_dim['width'] # In fact 'xmax' is never used + if self.font_dim['width'] <= 0: + logger.critical("Can not detect sane font width") + sys.exit(1) logger.debug("Final font cell dimensions %d w x %d h", self.font_dim['width'], self.font_dim['height']) self.xavgwidth.append(self.args.xavgwidth)