Skip to content

Commit

Permalink
font-patcher: Handle center aligned and overlapped glyphs
Browse files Browse the repository at this point in the history
[why]
When we have glyphs that need to be patched in with overlap into a
NerdFontPropo font, the advance width is not correct(ed).

[how]
I am not sure why specifically left and right alignment has been
mentioned, but of course center alignment also needs to be handled.

Overlap can be positive or negative, that does not matter here.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Nov 14, 2024
1 parent bd59368 commit 054dbc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ class font_patcher:
else:
width = sym_dim['width']
# If we have overlap we need to subtract that to keep/get negative bearings
if overlap and (sym_attr['align'] == 'l' or sym_attr['align'] == 'r'):
if overlap:
width -= overlap_width
# Fontforge handles the width change like this:
# - Keep existing left_side_bearing
Expand Down

0 comments on commit 054dbc0

Please sign in to comment.