Text rendering on bare metal, and with a cosmopoli...
# two-minute-week
k
Text rendering on bare metal, and with a cosmopolitan interface https://archive.org/details/akkartik-2min-2021-01-12 Limitations: * Just one screen resolution: 1024x768. Widely available on modern machines, no drivers needed. * Just 256 colors. I haven't looked hard at larger color depths. * Just keyboard, no mouse. Not even any shifted keys yet, though that's just a matter of time. * Just one bitmap font. Currently GNU Unifont. No bold, no italics, no proportional width. No anti-aliasing. Features: * Better internationalization. I'm trying to avoid past historical tendencies to focus on Latin languages and left-to-right writing order. I think I have a draft interface for text rendering that operates in terms of bounding boxes. I'm hoping that baking a little more complexity at the lowest level will simplify a lot at higher levels of the stack. Main project page: https://github.com/akkartik/mu
👍 8
c
Good luck with this stuff; text rendering is a hard problem that I still struggle with.
k
Thank you! I have no taste for this stuff, so always appreciate sometime telling me when something looks terrible or something. (Drat, I again forgot to say that it's a video. Just in case..)
j
Looking forward to seeing the bitmapped display version of your FORTH 🙂
❤️ 2
k
I've been trying to visualize the default 256-color palette I get on baremetal: http://akkartik.github.io/mu/html/baremetal/vga_palette.html To my eyes it looks like I can/should just live in the first 128 colors.
c
Yeah, I knew it was a video and watched it 🙂 I assume you are encoding everything with utf-8; the only sane choice? It may also be worth finding one of the 'complete' fonts that has all the unicode characters in it. I think Google does one.
k
Yeah, exactly, it's GNU Unifont, so there's room to grow there. The input side is tougher. I currently deal in ascii, and I don't really have a good plan for supporting other keyboards.
A simple etch-a-sketch program: http://akkartik.github.io/mu/html/baremetal/ex7.mu.html To run it on any non-Windows OS:
Copy code
git clone <https://github.com/akkartik/mu>
cd mu
./translate_mu_baremetal_emulated baremetal/ex7.mu
qemu-system-i386 disk.img
Use h/j/k/l to draw.
👍 1