summaryrefslogtreecommitdiff
path: root/write.c
diff options
context:
space:
mode:
authorChristopher Zimmermann <madroach@gmerlin.de>2020-07-31 00:07:26 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2020-09-22 22:00:38 +0000
commit0447b81053d4ccaa1e1b0087bf6076abae431cae (patch)
tree68d01d6b182984339903b4fc2e59902555ad86f4 /write.c
parent747c58aa17b9adc016aed0caab049417a20f0b22 (diff)
fix sign of sTypoDescender
Diffstat (limited to 'write.c')
-rw-r--r--write.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/write.c b/write.c
index 201ec5d..79b2c08 100644
--- a/write.c
+++ b/write.c
@@ -942,7 +942,7 @@ writehhea(FILE* out, FontPtr font)
writeULONG(out, 0x00010000); /* version */
writeSHORT(out, FONT_UNITS_CEIL(font->metrics.ascent)); /* ascender */
- writeSHORT(out, 0-FONT_UNITS_CEIL(font->metrics.descent)); /* descender */
+ writeSHORT(out, -FONT_UNITS_CEIL(font->metrics.descent)); /* descender */
writeSHORT(out, 0); /* lineGap */
writeUSHORT(out, FONT_UNITS(font->metrics.maxAwidth)); /* advanceWidthMax */
/* TODO: the next three are not calculated according to spec, are they ?
@@ -1121,11 +1121,11 @@ writeOS2(FILE* out, FontPtr font)
writeUSHORT(out, 0x20); /* usFirstCharIndex; */
writeUSHORT(out, 0xFFFD); /* usLastCharIndex; */
writeUSHORT(out, FONT_UNITS_CEIL(font->metrics.ascent)); /* sTypoAscender; */
- writeUSHORT(out, FONT_UNITS_FLOOR(font->metrics.descent)); /* sTypoDescender; */
+ writeUSHORT(out, -FONT_UNITS_CEIL(font->metrics.descent)); /* sTypoDescender; */
writeUSHORT(out, 0); /* sTypoLineGap; */
#ifdef NO_TYPO_METRICS
writeUSHORT(out, FONT_UNITS_CEIL(font->metrics.ascent)); /* usWinAscent; */
- writeUSHORT(out, FONT_UNITS_FLOOR(font->metrics.descent)); /* usWinDescent; */
+ writeUSHORT(out, FONT_UNITS_CEIL(font->metrics.descent)); /* usWinDescent; */
#else
writeUSHORT(out, FONT_UNITS_CEIL(font->metrics.maxY)); /* usWinAscent; */
writeUSHORT(out, -FONT_UNITS_FLOOR(font->metrics.minY)); /* usWinDescent; */