1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-01 16:55:57 +02:00

Remove negative bearings on 2048-em glyphs

Bisected an overlap issue in status bars to
https://github.com/ryanoasis/nerd-fonts/pull/283/files#diff-3b192ccaec850d73e6540b7eddd8b50cL710-R734
This commit is contained in:
Daniel M. Capella 2020-04-12 01:59:16 -04:00
parent ae56e33e93
commit d0bf73a19c
No known key found for this signature in database
GPG Key ID: EA4F7B321A906AD9
2 changed files with 5 additions and 6 deletions

View File

@ -773,17 +773,16 @@ class font_patcher:
align_matrix = psMat.translate(x_align_distance, y_align_distance)
self.sourceFont.transform(align_matrix)
# Ensure after horizontal adjustments and centering that the glyph
# does not overlap the bearings (edges)
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
# same width for all character glyphs. This needs to be done for all glyphs,
# even the ones that are empty and didn't go through the scaling operations.
# it should come after setting the glyph bearings
self.set_glyph_width_mono(self.sourceFont[currentSourceFontGlyph])
# Ensure after horizontal adjustments and centering that the glyph
# does not overlap the bearings (edges)
self.remove_glyph_neg_bearings(self.sourceFont[currentSourceFontGlyph])
# reset selection so iteration works properly @TODO fix? rookie misunderstanding?
# This is likely needed because the selection was changed when the glyph was copy/pasted
if symbolFontStart == 0:
@ -801,7 +800,7 @@ class font_patcher:
for glyph in self.sourceFont.glyphs():
if (glyph.width == self.font_dim['width']):
# Don't tough the (negative) bearings if the width is ok
# Don't touch the (negative) bearings if the width is ok
# Ligartures will have these.
continue