chiark / gitweb /
Correct underline position
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 26 Feb 2022 22:13:12 +0000 (22:13 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 26 Feb 2022 22:13:12 +0000 (22:13 +0000)
The correct underline position is (in my opinion) in the lowest pixel
of the character cell, in line with the descender of the "g".  This is
where the BBC Micro's cursor is by default.

It turns out that there are two ways to specify the underline
position: Type 1 fonts and AFM files specify the centre of the line,
while the OpenType 'post' table specifies the top edge ("for
historical reasons").  Experimentation demonstrates that FontForge's
"UnderlinePosition" uses the Type 1 definition and converts it to the
OpenType version as necessary.

bedstead.c

index 5d0b38695e6192bceac1a88038cba5c4a3ac7006..90cfb63470b0bc9917a2d7de921706d3b8f8ca45 100644 (file)
@@ -2284,7 +2284,7 @@ main(int argc, char **argv)
        printf("Copyright: Dedicated to the public domain\n");
        printf("Version: 002.003\n");
        printf("ItalicAngle: 0\n");
-       printf("UnderlinePosition: %g\n", (double)(-YPIX / 2));
+       printf("UnderlinePosition: %g\n", (double)(-3 * YPIX / 2));
        printf("UnderlineWidth: %g\n", (double)(YPIX));
        printf("OS2StrikeYPos: %d\n", (int)(3 * YPIX));
        printf("OS2StrikeYSize: %d\n", (int)(YPIX));