oppiliappan / scientifica

tall, condensed, bitmap font for geeks
SIL Open Font License 1.1
1.84k stars 29 forks source link

question: Font as byte arrays? #62

Open WhyNotHugo opened 1 year ago

WhyNotHugo commented 1 year ago

Hi, I'm writing on very basic image generation, and want to render this font without using a font-parsing library and all that huge tree of dependencies.

Due to it's pixel-based nature, I'd want just byte arrays for each letter. Basically like this JSON from monocraft.

Do you think it's possible to export scientifica into something like this that can be converted into a byte array at build-time?

NiLuJe commented 1 year ago

This is (sort of) the way I use it in FBInk (c.f., https://github.com/nerdypepper/scientifica/issues/33#issuecomment-613540901).

I whipped up a quick'n dirty Python script that mangles BDF (well, HEX, via gbdfed) fonts into a format suitable for a renderer based on font8x8 ;).

WhyNotHugo commented 1 year ago

Oh, that's very useful! The Pythons script is a very handy entry point, but also FBInk looks pretty useful for a future project I have in mind!