From: Ben Harris Date: Sat, 26 Feb 2022 22:13:12 +0000 (+0000) Subject: Correct underline position X-Git-Tag: bedstead-002.004~5 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=927f1fe478572304535b78e6ba568526abb51000;p=bedstead.git Correct underline position 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. --- diff --git a/bedstead.c b/bedstead.c index 5d0b386..90cfb63 100644 --- a/bedstead.c +++ b/bedstead.c @@ -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));