Skip to content

Commit

Permalink
font-patcher: Limit vertical overlap
Browse files Browse the repository at this point in the history
[why]
The vertical overlap has never been a problem (as far as I know). It is
maybe good to have some overlap for the terminal emulators that support
vertical overlap.
On terminals that truncate at the nominal cell border too much overlap
looks bad, i.e. the glyphs 'distorted'.

If we ever increase the overlap it is most likely be meant to be the
left-right overlap.

[note]
Originally this has been part of commit fecda6a of #780.

[note2]
Originally this has been part of PR #967.
Although that had a bug 😬
It used max() instead of min() (T_T)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Jan 12, 2023
1 parent 1637ef7 commit a9bc3d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ class font_patcher:
overlap = sym_attr['params'].get('overlap')
if overlap:
scale_ratio_x *= 1.0 + (self.font_dim['width'] / (sym_dim['width'] * scale_ratio_x)) * overlap
overlap = min(0.01, overlap) # never aggressive vertical overlap
scale_ratio_y *= 1.0 + (self.font_dim['width'] / (sym_dim['width'] * scale_ratio_y)) * overlap

# Size in x to size in y ratio limit (to prevent over-wide glyphs)
Expand Down

0 comments on commit a9bc3d2

Please sign in to comment.