Get the latest tech news

Converting C437 to XNA Spritesheets with Zig and Raylib


I’ve been struggling to get C437 PNG fonts loaded in Raylib due to its default PNG loader using a slightly different format. Here, I’ll detail a simple way of converting C437 PNGs to the format Raylib expects.

While Raylib’s text rendering is generally good, I wanted to be able to use old-school fonts using the Code page 437 character set. Although this restricts the fonts to a fixed-width size, this is generally what is desired for textual, grid-based games like traditional roguelikes. Note, for a reason I cannot figure out, Raylib refuses to properly render characters when its numerical value is over 128 so I’ve had to directly call DrawTextCodepoint instead of DrawText, which seems to avoid the issue.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of c437

c437

Photo of zig

zig

Photo of raylib

raylib