robhagemans / hoard-of-bitfonts

turns out I like bitmap fonts
Other
1.34k stars 51 forks source link

Add fonts from OS/2 3.0. #32

Closed Screwtapello closed 6 months ago

Screwtapello commented 10 months ago

Extracted from IBM OS/2 Warp 3.0 (Blue Spine) CD image, with SHA256 hash 429b90aa00b984300bcd1352849f0308861cf1bd1d5ad368649be508cf7d61da.

I noticed you had fonts from OS/2 1.3 and 2.1, but not OS/2 3.0.

3.0 was released in 1994, 30 years ago, so it should be comfortably outside the 25-year copyright window.

robhagemans commented 6 months ago

Hi, thanks for these! I think I didn't include 3.0 originally not because of copyright reasons, but because I was under the impression that they were indentical to the 2.1 fonts.

Out of interest, do you know where they differ? I haven't yet looked closely or done a diff, but maybe you know

Screwtapello commented 6 months ago

It's been a while since I made this branch, so I don't exactly remember, but if they're not identical to the 2.1 fonts then they're extremely similar. Still, I figured it's useful to know for sure that they're the same rather than leaving a gap.

(I really wanted to extract Warp Sans from OS/2 4.0, but apparently that file uses a different compression format from all the others, so I wanted to submit the fonts I had extracted before I got carried away trying with anything else)

robhagemans commented 6 months ago

Thanks, I've merged these. What file is Warp Sans contained in? I have a copy of warp 4.0 but so far I've only found the same bitmap fonts as here, plus some of the Windows bitmap fonts , a "cards symbol" font and something called MMPM Digital

robhagemans commented 6 months ago

There's a copy of Warp Sans in https://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/system/patches/warp_3/WarpSans_DSPRES_1996-04-29.zip which is an OS/2 LX DLL and seems to extract alright with monobit 0.42

Screwtapello commented 6 months ago

Warp Sans is contained in the DSPRES.DLL file.

There's also a fan-made extension of Warp Sans.

I figured for authenticity and provenance purposes, it would be best to be able to extract the font data from the official install media, rather than from a fan-recreation or something that presumably comes from an un-specified beta version.

robhagemans commented 6 months ago

Yes, ideally it should come from an official install. It looks like the DSPRES.DLL in the official install uses EXEPACK2 compression, and it also seems there is a bug in _lx_unpack_2 which is the function in monobit that should unpack that compression format, so the extraction fails.

My current hypothesis is that it's an off-by-one error as it produces a 4095-byte section which the comments say should be 4096 bytes.

The Warp Sans in OS/2 Warp 4.5 seems to be extractable however.

robhagemans commented 6 months ago

I've found the issue with _lx_unpack2; after a preliminary fix I can now extract DSPRES.DLL from Warp 4. It wasn't off-by-one, turns out I just need to fill with NULs to force the section size to 4096 - as was done in the original C code I ported, but apparently I thought I knew better :)

So the next version of monobit should be able to extract Warp Sans from 4.0 (and any other OS/2 fonts that use EXEPACK2).

Screwtapello commented 6 months ago

Thanks for looking into it!

After the next version of monobit is released, I can make a PR for Warp Sans if you don't get to it first. :)

robhagemans commented 6 months ago

I've released monobit 0.43.0 which includes the fix.

By the way, I just noticed that there's an issue with some of the yaff files for os/2 3.0 - it seems leading whitespace has been removed from the glyph definitions, which makes them not parsable as yaff has syntactic leading whitespace.

Maybe some text file processing took out the leading whitespace? Hoping you still have the originals...

robhagemans commented 6 months ago

Quick update, I've fixed the whitespace issues in the yaff files and also added OS/2 Warp 4 fonts

Screwtapello commented 6 months ago

Things came up that prevented me from getting back to this quickly enough, thanks for handling it!