Skip to content

Commit

Permalink
font-patcher: Fix glyphs with overlap
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
Finii committed Sep 6, 2022
1 parent 8f8776c commit f67de4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f67de4d

Please sign in to comment.