Skip to content

Commit ebf028b

Browse files
committed
[metrics] modify calculation for hhea and typo a + d to use abs() so that this matches documentation description
1 parent dcc8f61 commit ebf028b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fontline/metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def __init__(self, tt, filepath):
4242
) != 0
4343

4444
# Calculated values
45-
self.os2_typo_total_height = self.os2_typo_ascender - self.os2_typo_descender
45+
self.os2_typo_total_height = self.os2_typo_ascender + abs(self.os2_typo_descender)
4646
self.os2_win_total_height = self.os2_win_ascent + self.os2_win_descent
47-
self.hhea_total_height = self.hhea_ascent - self.hhea_descent
47+
self.hhea_total_height = self.hhea_ascent + abs(self.hhea_descent)
4848

4949
self.hhea_btb_distance = self.hhea_total_height + self.hhea_linegap
5050
self.typo_btb_distance = self.os2_typo_total_height + self.os2_typo_linegap

0 commit comments

Comments
 (0)