font-patcher: Fix: Fix line gap redistribution

[why]
With commit
  e69a025a8  font-patcher: Fix line gap redistribution
we fixed the wrong adding instead of subtraction of the bottom gap part
from the descenders.

At least this was done for HHEA and TYPO values.

With WIN values the descenders have positive (!) numbers, so the sign
was not changed for the WIN case.

But that is wrong, as we are already in the ymin xmax coordinate system
(and took the negative of the WIN descenders). So of course here also we
need to subtract and not add.

Mentioned in: #1116

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-02-12 16:59:29 +01:00
parent 468b2b974f
commit b112fe12de

View file

@ -1018,7 +1018,7 @@ class font_patcher:
self.font_dim['ymin'] = self.sourceFont.os2_typodescent - half_gap(self.sourceFont.os2_typolinegap, False)
self.font_dim['ymax'] = self.sourceFont.os2_typoascent + half_gap(self.sourceFont.os2_typolinegap, True)
else:
self.font_dim['ymin'] = -self.sourceFont.os2_windescent + half_gap(win_gap, False)
self.font_dim['ymin'] = -self.sourceFont.os2_windescent - half_gap(win_gap, False)
self.font_dim['ymax'] = self.sourceFont.os2_winascent + half_gap(win_gap, True)
# Calculate font height