From 927f1fe478572304535b78e6ba568526abb51000 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 26 Feb 2022 22:13:12 +0000 Subject: [PATCH] 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. --- bedstead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- 2.30.2