maettig.com

Free-Font and VGA graphics library (1999)

← Back to the index of my DOS archive

A serious limitation of the graphics mode support build in QBasic and the compatible PowerBASIC was that text placed on the screen with the usual LOCATE and PRINT commands was limited to the same character grid as in a text mode: 80 columns, typically 25 rows, and a single set of characters fixed to either 8 by 8, 8 by 14, or 8 by 16 pixels each. I worked on a programing library to break out of these limitations. Unfortunately I was not able to utilize inline assembler back then. My library was pretty slow because of this and I never used it in a serious project. However, the library itself became an actual product, with a version number, example scripts, and an extensive manual.

Font editor

I had a lot of fun constructing my own fonts, as well as collecting existing ones. My editor supports the typical .fnt file format where characters are stored as 8 pixel wide (1 byte) bit-masks, as well as some slightly modified file formats I invented. The .ff1 format encodes fixed-with fonts that are smaller than 8 pixels, and .ff2 files contain variable-with fonts.

VGA graphics library

I will never really understand why my beloved PowerBASIC never had build-in support for the VGA mode 13h with 256 colors. Luckily this mode is super-easy to pull off: just some interrupts, and pokes to the screen memory at &hA000. I collected all I learned about the mode in a small include file. It contains functions to draw pixels, lines, rectangles and such, as well as methods to manipulate the palette. I made it part of the font library because I wanted fonts in all graphics modes, and combining the two "essential" graphics libraries felt natural.

Download the Free-Font and VGA graphics library for PowerBASIC