@nina_kali_nina alright got reply from John:
I can see a flaw in the Windows font loader where for Windows 1.x fonts
it reads and writes 0x75 bytes of header but other functions assume the
header is 0x76 bytes long. The attached diff seems to make the win1fonts
test script work for me, though I don't know what knock-on effects there
might be to the other psftools utilities.
(Assuming that the Windows 1 font header is actually 0x76 bytes long
would be another way round, because it's usually followed by the font
bitmap which has to be word-aligned, but the spec doesn't seem to rule
out having (for example) the face name immediately follow the header and
that doesn't seem to have the same constraint.)
I don't think I've written a tool to convert FNT files directly from
Windows 2.x to Windows 1.x format, but it doesn't sound impossible.
with a code diff:
--- psftools-1.0.12/winfonts/mswfntr.c 2002-07-14 02:10:16.000000000 +0100
+++ winfonts/mswfntr.c 2026-01-05 14:44:03.264816005 +0000
@@ -86,8 +86,15 @@
if (!addr) return -3;
/* Work out font size. This is f->dfSize minus header size */
- if (f->dfVersion >= 0x0300) base = 0x9A;
- else base = 0x76;
+ /* Note: It's doubtful whether to consider the Windows 1.x font
+ * header as 0x75 bytes followed by an alignment byte, or as
+ * 0x76 bytes. Here I am assuming 0x75. Usually what follows
+ * the Windows 1 font header is the bitmap which has to be
+ * word-aligned anyway. The important thing is that 'base' needs to
+ * match the number of bytes read by msw_fontinfo_read() */
+ if (f->dfVersion >= 0x0300) base = 0x9A;
+ else if (f->dfVersion >= 0x0200) base = 0x76;
+ else base = 0x75;
size = f->dfSize - base;
--- psftools-1.0.12/winfonts/mswfntw.c 2002-07-14 02:18:30.000000000 +0100
+++ winfonts/mswfntw.c 2026-01-05 14:44:20.957256323 +0000
@@ -88,8 +88,15 @@
if (!addr) return -3;
/* Work out font size. This is f->dfSize minus header size */
- if (f->dfVersion >= 0x0300) base = 0x9A;
- else base = 0x76;
+ /* Note: It's doubtful whether to consider the Windows 1.x font
+ * header as 0x75 bytes followed by an alignment byte, or as
+ * 0x76 bytes. Here I am assuming 0x75. Usually what follows
+ * the Windows 1 font header is the bitmap which has to be
+ * word-aligned anyway. The important thing is that 'base' needs to
+ * match the number of bytes read by msw_fontinfo_read() */
+ if (f->dfVersion >= 0x0300) base = 0x9A;
+ else if (f->dfVersion >= 0x0200) base = 0x76;
+ else base = 0x75;
size = f->dfSize - base;
(P.S.: John put your email into recipient list so you may find same mail in your inbox as well)