Character Set Tools

What is it?

Character Set Tools is intended to aid in the creation of collections (sets) of the small, reusable graphics (known as tiles or characters) used by older (especially 8 and 16 bit) systems. It currently consists of a pair of programs, mkchr and unmkchr which convert XPM images to and from different binary formats used by these older systems.

Why is this useful?

Binary formats are inconvenient to edit and don’t interact well with many version control systems, XPM files, in contrast, are textual so they work with most version control systems and they are widely supported by image viewers and editors. The tools also plug nicely into Makefile-like systems allowing for automatic generation (and regeneration) of character sets from art assets and automatic (re-)generation of any file that includes those character sets. Succinctly; the tools enable a workflow that allows convenient editing, versioning and compilation of character sets.

How do I use it?

To create a character set from scratch first create an XPM file which has a width and height that is a multiple of the character format’s width and height using only as many colours as the format supports and pass it to mkchr as so:

mkchr -f m3-mode4 -o charset.bin charset.xpm

Characters will be read from the image left-to-right, top-to-bottom. If the image is not the correct dimensions the excess on the right and bottom edges will be cropped in memory. If the correct number of colours are present but the indices are not in the range 0 to max_colours then the image will be reindexed in memory.

To convert an existing character set to an XPM file use unmkchr as so:

unmkchr -f m3-mode4 -o charset.xpm charset.bin

The resulting characters will be arranged in a grid if they can be made to divide into an even number of columns.

Where do I get it?

The character set tools GIT repository


This page is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.