summaryrefslogtreecommitdiff
path: root/write.c
diff options
context:
space:
mode:
authorChristopher Zimmermann <madroach@gmerlin.de>2020-05-31 08:02:24 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2020-09-22 22:00:38 +0000
commit8532812f1eddfadc0bcfad220b283bf5990bba10 (patch)
treed78ed59e6fb71b5e324320921b6b7ee78540cc55 /write.c
parentde8068f9c4251fb6cb9407c07bf245e1937270bc (diff)
use zero lineGap, sTypoDescender should be negative
According to https://simoncozens.github.io/fonts-and-layout/opentype.html#vertical-metrics-hhea-and-os2 sTypoDescender should be negative and lineGap should be zero.
Diffstat (limited to 'write.c')
-rw-r--r--write.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/write.c b/write.c
index c8a86e4..067732f 100644
--- a/write.c
+++ b/write.c
@@ -851,7 +851,7 @@ writehhea(FILE* out, FontPtr font)
writeULONG(out, 0x00010000); /* version */
writeSHORT(out, FONT_UNITS_CEIL(max_y)); /* ascender */
writeSHORT(out, FONT_UNITS_FLOOR(min_y)); /* descender */
- writeSHORT(out, FONT_UNITS(TWO_SIXTEENTH / 20)); /* lineGap */
+ writeSHORT(out, 0); /* lineGap */
writeUSHORT(out, FONT_UNITS(max_awidth)); /* advanceWidthMax */
writeSHORT(out, FONT_UNITS_FLOOR(min_x)); /* minLeftSideBearing */
writeSHORT(out, FONT_UNITS_FLOOR(min_x)); /* minRightSideBearing */
@@ -1017,9 +1017,8 @@ writeOS2(FILE* out, FontPtr font)
writeUSHORT(out, 0x20); /* usFirstCharIndex; */
writeUSHORT(out, 0xFFFD); /* usLastCharIndex; */
writeUSHORT(out, FONT_UNITS_CEIL(max_y)); /* sTypoAscender; */
- writeUSHORT(out, -FONT_UNITS_FLOOR(min_y)); /* sTypoDescender; */
- writeUSHORT(out, FONT_UNITS(max_y - min_y));
- /* sTypoLineGap; */
+ writeUSHORT(out, FONT_UNITS_FLOOR(min_y)); /* sTypoDescender; */
+ writeUSHORT(out, 0); /* sTypoLineGap; */
writeUSHORT(out, FONT_UNITS_CEIL(max_y)); /* usWinAscent; */
writeUSHORT(out, -FONT_UNITS_FLOOR(min_y)); /* usWinDescent; */
writeULONG(out, 3); /* ulCodePageRange1; */