font-patcher: Fix align formula

[why]
This is more an academic fix. If we calculate widths from with bounding
boxes we always need to take xmin and xmax into account. Usually xmin is
zero and so it does not make any difference.

But maybe one can see better what is calculated, especially as we use
xmin in other cases.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-03-02 20:06:31 +01:00
parent ac3cb23929
commit cf253a2b9c

View file

@ -1355,7 +1355,7 @@ class font_patcher:
if not self.args.single and '2' in sym_attr['stretch']: if not self.args.single and '2' in sym_attr['stretch']:
x_align_distance += self.font_dim['width'] x_align_distance += self.font_dim['width']
# If symbol glyph is wider than target font cell, just left-align # If symbol glyph is wider than target font cell, just left-align
x_align_distance = max(-sym_dim['xmin'], x_align_distance) x_align_distance = max(self.font_dim['xmin'] - sym_dim['xmin'], x_align_distance)
if overlap: if overlap:
overlap_width = self.font_dim['width'] * overlap overlap_width = self.font_dim['width'] * overlap