From f67de4d7b0adc2bb34f19560e1f884bc482163ff Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Mon, 7 Feb 2022 15:11:08 +0100 Subject: [PATCH] font-patcher: Fix glyphs with overlap [why] For some powerline symbols we add a certain amount of overlap into the previous or next character to cover up a small gap between the symbols that otherwise can show up as ugly thin (usually colored) line. But after we carefully design that glyph with a bit overlap (over-sized and having negative bearings) we remove all bearings. That breaks of course the glyph and no actual overlap on the left side happens. [how] Just do not remove negative bearings on overlap-enabled glyphs. As they are rescaled in both directions anyhow all bearings are wanted and must be kept. Reported-by: Mihail Ivanchev <@MIvanchev> Signed-off-by: Fini Jastrow --- font-patcher | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/font-patcher b/font-patcher index e86969ec1..85ac64430 100755 --- a/font-patcher +++ b/font-patcher @@ -1058,7 +1058,8 @@ class font_patcher: # Ensure after horizontal adjustments and centering that the glyph # does not overlap the bearings (edges) - self.remove_glyph_neg_bearings(self.sourceFont[currentSourceFontGlyph]) + if not overlap: + self.remove_glyph_neg_bearings(self.sourceFont[currentSourceFontGlyph]) # Needed for setting 'advance width' on each glyph so they do not overlap, # also ensures the font is considered monospaced on Windows by setting the