From dd3ed4dc744f2c8d83fef40dba42c064d889991f Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Sun, 22 Jan 2023 14:50:43 +0100 Subject: [PATCH] font-patcher: Fix Monofur 'Nerd Font Mono' too wide [why] Although Monofur is monospaced it has one glyph (hyphen) that is slightly wider than all others. This results in a Monospaced font that is slightly too wide. [how] Ignore the hyphen width. [note] Additionally improve (commented out) debug code (shows now hex codepoint). Signed-off-by: Fini Jastrow --- font-patcher | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/font-patcher b/font-patcher index f0360c913..2c5ec3982 100755 --- a/font-patcher +++ b/font-patcher @@ -986,6 +986,7 @@ class font_patcher: 0x132, 0x133, # IJ, ij (in Overpass Mono) 0x022, 0x027, 0x060, # Single and double quotes in Inconsolata LGC 0x0D0, 0x10F, 0x110, 0x111, 0x127, 0x13E, 0x140, 0x165, # Eth and others with stroke or caron in RobotoMono + 0x02D, # hyphen for Monofur ]: continue # ignore special characters like '1/4' etc and some specifics try: @@ -999,10 +1000,10 @@ class font_patcher: print("Warning: Extended glyphs wider than basic glyphs, results might be useless\n {}".format( report_advance_widths(self.sourceFont))) warned = True - # print("New MAXWIDTH-A {} {} -> {} {}".format(glyph, self.sourceFont[glyph].width, self.font_dim['width'], xmax)) + # 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 - # print("New MAXWIDTH-B {} {} -> {} {}".format(glyph, self.sourceFont[glyph].width, self.font_dim['width'], xmax)) + # print("New MAXWIDTH-B {:X} {} -> {} {}".format(glyph, self.sourceFont[glyph].width, self.font_dim['width'], xmax)) # print("FINAL", self.font_dim)