color
scheme

June 18, 2024

legible?

MacOS build Source

So, I've been enjoying making small demos using the Odin programming language + Raylib for graphics. I've made a simple demo showing off an implementation of the Bresenham line algorithm to render some "fonts" which were buried in an old graphics library. These fonts aren't like modern scalable vector fonts, nor are they pixel fonts, but instead are encoded simply as pairs of points for line segments to be drawn between.

Raylib was inspired in part by the Borland Graphics Interface library, graphics.h in particular, which gave programmers going back to the 1980s an easy API to draw graphics to the screen.

line font rendered with graphics.h

I don't remember exactly how, but I discovered that graphics.h included a few primitive, hard-coded vector fonts. These fonts are interesting to me because they don't use filled shapes like modern fonts, but instead utilize only straight line segments, drawn with a basic algorithm. This puts them more in line with the single-stroke fonts that CAD people are familiar with.

For how widely used they are in the fields of engineering, architecture and CNC projects of all kinds, single-stroke fonts are under-documented to the point of not even having a formal classification (that I can find) in the way that other areas of type do. They are purely utilitarian, and their use seems relatively unchanged going back to the early days of CAD. The first monitors that were used for CAD were vector displays, going back to the 1960s. These displays were suited to the task of drawing high-resolution line artwork to a degree that was hard to surpass into the 1990s.

Single-stroke fonts in the wild.
The weight is determined by the engraving tool, not the font data.
A single-stroke font on a vector display

CAD single-stroke fonts are much more advanced than the Borland fonts as they include arcs along with line-segments, and their source data is at a much higher resolution. So, while the fonts from graphics.h were likely not used in CAD software, there is an interesting thread of methodology here; where, for the Borland library authors, the most straightforward, efficient way to get some scalable text rendering into the library was to use line segments rather than fills.

Anyway, that's all for now. Windows + Linux builds incoming + more features, maybe even editable text.