1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-11-19 16:39:20 +02:00

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 <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-02-07 15:11:08 +01:00
parent 8f8776cf30
commit f67de4d7b0

View File

@ -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