<- Back
Comments (14)
- drfuchsFor prior related work, check out patent US-6377261-B1 "Compiling glyphs into instructions for imaging for execution on a general purpose computer" filed 1996. The basic idea is each character turns into a sequence of "Load Immediate" / "Shift" / "OR to Memory" instructions; so there's no more fetching from a stored bitmap of the font, as the pixels are implicit in the Immediate data in the generated machine code. Then you can get fancy when one row of pixels is the same as the previous row in the character, so you don't even need to do the Load Immediate. Etc. This scheme was used in FrameMaker for Macintosh back in the day, as implemented by Gus Fernandez (who went hog wild on additional optimizations).
- londons_exploreRelated: for a project I needed readable vector fonts in as few bytes as possible. Had to handle full Unicode and any font face.Setting Claude on the challenge and giving some pointers (use a set of ANS coders! Be lossy as long as there are no errors when rendered!), I was amazed that a typical font can be rendered in just ~40 bytes per used character.It saddens me that despite this, plenty of websites ship hundreds of kilobytes of custom fonts!
- drzaiusx11The "racing the beam" technique extended the life of many RAM-strapped systems back in the day, like the Atari VCS/2600 (which ran a 6507 with 128 bytes of RAM!) It's amazing what you can do with it on machines which basically have no RAM and a little software to control the electron beam.
- sehuggFunny, I was just thinking about JIT'ted blitters the other day. I'm pretty sure the Windows 3.1 BitBlt function was a JIT, probably building a blitter routine from templates, as they had to handle different src/dest ops, different bits-per-pixel and also linear/planar frame buffers.Symbolasm looks neat.
- karmakazeThis is a really great project. So many retro computers are OP that they can use large frame buffers and programming to them doesn't feel like being close to the metal back like back in the day which was more intimate.This implementation reminds me of two of my early experiences: programming display lists on Atari 8-bit and an HP PCL 5e interpreter (with short raster band buffer). I didn't really get into VCS/2600 128-byte beam racing but did do a fair amount of display-list-interrupt on-the-fly coding for homemade games and demos. I really thought the Atari Antic display list system was terrific--thanks to Jay Miner who also did the Amiga--and didn't see much like it again until OS/2 Presentation Manager or Java FX.The PCL interpreter probably had the closest shape using a few hundred line cyclic buffer. It 'rendered' into y-sorted objects that needed to be later rendered/rasterized. Each object was cut to be at most 255 pixels (0.85") tall and used reverse max-y ordering since it couldn't be drawn until after the beam passed the wraparound scan line still rendering Y - buffer_height.
- codazodaI've been building BASIC32, a retro BASIC interpreter for microcontrollers so I can flash it once and easily create lots of new projects.What you give up with the authors approach is "read". The screen becomes write-only. There are only a few functions that require reads: getting a pixels current color and doing operations like flood fills or paints.Because I was going for the retro feel of BASIC, I wanted to support these, so I opted for a frame buffer. It isn't as technically cool. On the RP2350, it does require low resolution and low bit rates because they often have RAM limited to KB.If you step-up to the ESP32-S3 variants with 4MB or 8MB of RAM the frame buffer gets much easier.
- dsignAdded "race the beam" to my personal dictionary today :-). It's such a breath of fresh air to read something which is not written by an LLM.
- erichoceanThis is cool, I did something similar with a CoreText replacement I've been building recently.My code can JIT + render to the atlas faster at p100 than CoreText can render without the JIT at p50, and with better quality (measured against an exact cover reference).
- cobaltpath[flagged]
- toolbrewlabThe dot-product kerning trick is the bit I keep coming back to — encoding each glyph's edge profile as a bitvector and letting the overlap popcount decide the spacing feels like the sort of elegant hack that only falls out of genuinely understanding the problem. Also appreciated the honesty about the LLM-assisted parts; the cycle-count analysis is clearly hand-checked either way. I wonder how far the packed-font idea scales before the packing overlaps start costing more than they save.