font-patcher: Do x-scale powerline glyphs

[why]
For the non-Mono variants ('Nerd Font' and 'Nerd Font Propo') the
Powerline symbols are scaled in Y but the width is just kept from the
symbol font, whatever that might be (and if it makes any sense).

If you have for example the triangular thing (`E0B0`) it is bigger than
'one cell' and extrudes into the following cell (on 'Nerd Font'). For
the other side (`E0B2`) it is even worse; it is right aligned in the
current cell and so (because it is wider than one cell) it protrudes
into the previous cell.

[how]
Just allow not only Y scaling but also X scaling for non-Mono fonts.

[note]
This is of relevance just for 'xy' scaling, and only the Powerline
symbols do that.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-01-12 10:59:55 +01:00
parent b3c079d6d3
commit a6a5a38af5

View file

@ -999,8 +999,7 @@ class font_patcher:
scale_ratio_y = scale_ratio_x scale_ratio_y = scale_ratio_x
else: else:
# Keep the not-stretched direction # Keep the not-stretched direction
if not self.args.single or not 'x' in stretch: if not 'x' in stretch:
# non monospaced fonts scale y, on 'y' scale request (not x)
scale_ratio_x = 1.0 scale_ratio_x = 1.0
if not 'y' in stretch: if not 'y' in stretch:
scale_ratio_y = 1.0 scale_ratio_y = 1.0