diff options
author | Christopher Zimmermann <madroach@gmerlin.de> | 2020-05-31 08:02:24 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-09-22 22:00:38 +0000 |
commit | 8532812f1eddfadc0bcfad220b283bf5990bba10 (patch) | |
tree | d78ed59e6fb71b5e324320921b6b7ee78540cc55 /write.c | |
parent | de8068f9c4251fb6cb9407c07bf245e1937270bc (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.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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; */ |