as it so often is, it's time to do crimes against typography with pixel fonts

I need to copy a font off my windows 98 machine to my Raspberry Pi's framebuffer application.

obviously the way to do this is to just render out every character the font supports to bitmaps and then import those as spritesheet

based on file metadata, I've been trying to do this since April, and I think every time I've opened a text editor to write the simple python script I need, someone has messaged me on discord

fine I'll close discord and just be offline for an hour

and someone walks into my bedroom asking about help finding a cable

okay I generated it

and the part from April is wrong, and I need to fix it on Windows 98. DAMN IT

I'm glad Pillow now has .get_flattened_data to match .getdata, especially since neither of them do what I want, and have never done what I want

future foone:

it's Image.tobytes() that you want

okay I have the font imported and a very simple (no wrapping or newline handling) text engine:
THIS IS THE WRONG FONT (SIZE)
I've extracted MS Sans Serif 10 point. I need MS Sans Serif 8 point.
every day is a good day to pull out Visual C++ 6.0!
just kidding, I've already crashed the OS in that screenshot. The cursor switched to the text cursor and is stuck that way, you can't click anything

oh no, I need unicode support
in windows 98

I need unicows

oh good there's an open source replacement, OpenCow:
https://opencow.sourceforge.net/
Opencow

I do not recall how you do ASCII/Unicode dual-use source code. There's some macro you gotta wrap around your string literals, I seem to remember
MSLU: Develop Unicode Applications for Windows 9x Platforms with the Microsoft Layer for Unicode

the secret macro is _T("foobar") which'll do nothing in ASCII mode, but if _UNICODE is defined, it turns "foobar" into "unicode", by which they mean UCS-2
I copy-pasted UNICOWS.DLL into C:\WINDOWS\SYSTEM which of course crashed Explorer, because Windows 98
I still don't have UNICOWS.LIB and it may be a pain to get it
I think I can maybe get it from the Windows XP Platform SDK? Lets see if I can still get to it on a Windows 98 system.
oh goody you have to install everything and win98 can't run the MSIs
I do not currently have a local XP VM
okay it won't work. I think the API I'm using is not supported on win9x. I could check the docs but they pretend XP was the first windows
ok I went and remoted into another computer and used the XP compiler over there and got it done. I could have done this at the beginning but I was stubborn

ugh except this is ALMOST right.
The problem is: this is XP's MS Sans Serif, not Windows 98's.

Yeah they changed it a lot, mainly adding a bunch more characters for better language support.

I wonder if anyone has done a page showing
1. which fonts are included on windows
2. how they've changed over time

okay so the function call that I need that's missing from Windows 98 is called GetFontUnicodeRanges.

And the MSDN docs on my visual studio 6.0 discs does talk about it, but this is neat: it's a preliminary doc!

And here's the compatibility matrix!
NT needs 5.0, Windows 9x/me is unsupported, and CE is unsupported. You can't do this on your HP Jornada 720.
This is Visual Studio 6.0, which came out in 1998, so Windows 2000 and Windows XP don't exist yet. The latest available NT is NT4.
@foone i *know* i've seen one of these but i think it was in 2011 or 2012

@foone I ran into this when making an SVG of California's “this product contains cannabis” symbol. The state's website had it as PNG, JPEG, and PDF, and the PDF used a particular font for the exclamation point. And only the Vista version has the *right* exclamation point.

https://commons.wikimedia.org/wiki/File:California_cannabis_universal_symbol.svg#filehistory

File:California cannabis universal symbol.svg - Wikimedia Commons

@foone I bet someone whose business is based on identifying users by fingerprinting has the data, at least at the newer end, but they probably wouldn't make it public...
@foone Rendering each letter might be insufficient. Because of kerning and hinting. Might need every glyph pair instead. For non-monospace fonts at least.
@foone I downloaded some old Win32 docs in *.HLP format from https://www.carabez.com/downloads.html
@foone I also have a Dependency Walker like application that works on modern Windows. You can use it to check if an old DLL exports some API or not. Or you can use the original Dependency Walker if you are on old enough system. https://github.com/MarekKnapek/DependencyViewer
@foone Kaplan, not Kaplin. What we did back then was to write the code once, then compile twice. One for ANSI Windows, second for Unicode Windows. We used the _T and _TEXT macros. One was meant to be internal for CRT/MFC/whatever, the second macro was meant for us, the users.

@MarekKnapek whoops, fixed. Thanks!

Interesting. I only need this code to run on Win9x, so I don't need two copies: I just need better unicode support if I'm gonna have it run on win98, since I need some unicode APIs

@foone *opens cow, looks inside* milk.
@HorayNarea a couple years ago I was working on a dairy farm simulator with another dev, but we never came up with a game name. Maybe we should have used OpenCows
@foone ØpenCöws, just so you need unicows for the Win9x release
@foone college dating sim with anthropomorphized dairy animals: "UniCows" 🤔
@foone C++ stands for Crash Plus Plus
@foone the windows 9x special
@shinyjirachi @foone Huh, now I wonder how bad Windows 9x really is - I haven't had experience with anything older than XP as a kid and 2000 in a VM, but I've heard about how much less stable 9x was before XP with its NT protocol released ​
@radmin @foone @shinyjirachi the NT kernel isn't even comparable to the monstrosity that is the 3.1/9x/ME series - those boot into DOS and then the windows kernel kinda scoops DOS's brain out and parasitises it
@foone wow, this takes me back to tinkering with the Uplink Developer CD on a big chunky Pentium 3 laptop
@foone I am soooo not gonna miss 800x600 displays. or 1024x600...
@whitequark @foone These days I find even 1920x1080 too little. You either don’t get enough context of a file on them, or text becomes hard to read because of the low DPI. My current employer when I started (in 2026!) had a default setup of 2x 24” 1080p monitors. The first thing I did was upgrading mine and a colleague’s setups to 32” 4k.
@whitequark god yeah. I like being able to see more than a couple lines of my code

@foone @whitequark When doing some Apple II retrocomputing a year or two ago, I was reminded how essential a *printer* was back in the day, to be able to get a look at code in larger chunks than a 40x25 or 80x25 screen at a time.

I printed a lot of the Hack source on an Epson pinfeed dot matrix printer... what a way to learn C and (simple) data structures...

@swetland @foone i didn't have a printer so i just kinda suffered?
@whitequark @foone If it makes you feel better, cheap dot matrix printers were a mixed blessing at best. Noisy, slow, prone to mis-feeding and jamming...
@swetland @foone oh, the sounds are absolutely burned into my memory (tbh I kind of miss them)
@swetland @whitequark @foone
Okidata Microline 590.
Never jammed.
@whitequark @foone that upgrade to the first 1600x1200px TFTs was soooooo nice <3
@manawyrm @whitequark @foone Never had a 1600x1200 TFT, went from 1280x1024 to 1920x1200.
@manawyrm @whitequark @foone Everything was so tiny I thought there's no way you're supposed to use it at the native resolution and set it back down to 1280x960. 😓
@indigoparadox @whitequark @foone my ears were always crap, but my eyes were always good, so i was running at full res :D
(altough i'm starting to get close to my 30s now, I can't handle a 24" 4k display at native res/96dpi anymore xD)

@foone

I love that you can kinda sorta see the pathway from this to modern Visual Studio

@foone aint there some older Sans Serif and then there's the newer one used in 2000 and such lol