Skip to content

Commit

Permalink
font-patcher: Fix 2 cell glyphs with overlap
Browse files Browse the repository at this point in the history
[why]
Glyphs that shall end up in two cells with xy scaling and overlap (for
example E0C0, E0C2) end up being a bit too wide.
In fact the width is the 2 cell width and 2 overlap width.

[how]
Apply the overlap (which is 'percent' factor) not on the concrete glyph
width, which is 2*cellwidth in these cases, but base it on the
one-cell-width instead.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Nov 17, 2024
1 parent dd8cc30 commit bea6001
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 @@ -1373,7 +1373,7 @@ class font_patcher:

target_width = self.font_dim['width'] * self.get_target_width(stretch)
if overlap:
target_width *= 1.0 + overlap
target_width += self.font_dim['width'] * overlap
scale_ratio_x = target_width / sym_dim['width']

# font_dim['height'] represents total line height, keep our symbols sized based upon font's em
Expand Down

0 comments on commit bea6001

Please sign in to comment.