1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-31 12:27:22 +02:00

font-patcher: Fix wrong advance width after group scale

[why]
The advance width in the bounding box data is sometimes wrong (usually
to small). Turned out only AFTER the glyph scaling.

[how]
The wrong scaling factor has been used *duh*.
Advance width is of course X axis.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-01-03 11:26:01 +01:00
parent 3cfe4a1a06
commit dc3b2183b4

View File

@ -1346,7 +1346,7 @@ def scale_bounding_box(bbox, scale_x, scale_y):
'ymin' : int(bbox['ymin'] * scale_y),
'xmax' : int(bbox['xmax'] * scale_x),
'ymax' : int(bbox['ymax'] * scale_y),
'advance': int(bbox['advance'] * scale_y) if bbox['advance'] else None,
'advance': int(bbox['advance'] * scale_x) if bbox['advance'] else None,
}
new_dim['width'] = new_dim['xmax'] + (-new_dim['xmin'])
new_dim['height'] = new_dim['ymax'] + (-new_dim['ymin'])