From 1d7c4f77917c44881d425970c80ff464a697adbe Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Wed, 15 Feb 2023 16:50:29 +0100 Subject: [PATCH] font-patcher: Issue warning on width irregularities [why] For some reason we determine the bounding box xmax value of the 'normal' extended glyphs. For the cell size we use the advance width of those glyphs - the xmax values is not utilized at all. But if we would ever use it, it might be good to see that something unexpected(?) happened. This commit is not really necessary. Maybe it is good, maybe it just adds noise. We can always remove it later. No functional change. Signed-off-by: Fini Jastrow --- font-patcher | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/font-patcher b/font-patcher index 26fe043e6..bb251095d 100755 --- a/font-patcher +++ b/font-patcher @@ -1108,7 +1108,14 @@ class font_patcher: # print("New MAXWIDTH-A {:X} {} -> {} {}".format(glyph, self.sourceFont[glyph].width, self.font_dim['width'], xmax)) if xmax > self.font_dim['xmax']: self.font_dim['xmax'] = xmax + if not warned and glyph > 0x7a: # NOT 'basic' glyph, which includes a-zA-Z + print("Warning: Extended glyphs wider than basic glyphs\n {}".format( + report_advance_widths(self.sourceFont))) + warned = True # print("New MAXWIDTH-B {:X} {} -> {} {}".format(glyph, self.sourceFont[glyph].width, self.font_dim['width'], xmax)) + if not self.args.quiet and self.font_dim['width'] < self.font_dim['xmax']: + print("Warning: Font has negative right side bearing in extended glyphs") + self.font_dim['xmax'] = self.font_dim['width'] # In fact 'xmax' is never used # print("FINAL", self.font_dim)