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
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
future foone:
it's Image.tobytes() that you want
oh no, I need unicode support
in windows 98
I need unicows
oh here's some info on how to use it:
and look, it was written by the late Michael Kaplan.
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.
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!
okay wait, I'm a fool: The font isn't different, this is a different font.
"Microsoft Sans Serif" and "MS Sans Serif" are two different fonts. obviously.
the last 4 hours may have been a diversion to not have to think about wordwrapping.
I mean, I guess python has a wordwrap module built in I can just use that, it'll be decent-enough.
I could modify the built in python module wordwrap:
https://github.com/python/cpython/blob/main/Lib/textwrap.py
or I could port the JS/TS algorithm I already have in the Death Generator.
but that one is, uh, Not Simple.
@foone You need to count pixels. It is an absolute bear I've been avoiding for ages in mine. You could probably do it as a Dictionary and define whatever exceptions you need and then fail to the most common value, but...
We'll just say I've limited myself to fixed-width fonts and used tiles as exceptions. XD
@foone It was almost 10 years ago since I implemented my own font rendering in Android. Iirc, for word wrapping you will have to read-ahead each symbol, accumulating the width as you go, only set it to stone when you reach a whitespace, and move it down if you reach the max width.
You could easily do it with an O(n) algorithm, and optimize with dynamic programming if you group each word in beforehand.
....and this is the point at which I saw the thread, clearly indicating that something truly bizarre is going on in here.
@foone VM snapshots are free*, I'd go with the latter
(*ok technically not but it's an XP VM, what's the snapshot gonna consume, 100MB?)
@foone When I was taught C++ in the University, we were told about exceptions, they were in the specification.
But we still checked for null pointers because AIUI no compiler supported exceptions back then.
@foone I appreciate that MSVC is like, mostly unchanged still from a UI perspective. You still go in and set your include directories in the exact same way you did in 6.0.
I'm sure they'll fuck it up with AI at some point in a few years or something though.
@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