Home Small Font Format Specification
Post
Cancel

Small Font Format Specification

Preamble

The Small Font Format is intended for use in embedded applications, where a small font is required. The format is monochrome only, and will remain so for the foreseeable future. In its first iteration, the format supports only 8x8 character sizes. However, 4 bytes have been reserved in the header to allow for future expansion, which could perhaps include support for variable size fonts.

Edit 2023-06-14: Relevant XKCD - Standards, I’m fairly certain someone else has already done this. I’d probably be better off adapting FBConsole to use the existing standard. And yet, here we are.

Version history

Version Notes
v1.0 Initial release

Version history

File format

Header - 8 bytes

Offset Length Description Expected value
0x00 3 bytes Magic header 53 46 46
0x03 1 byte Format version 10
0x04 4 bytes Reserved 00 00 00 00

Header format

  • Magic Header - The 3 bytes 53 46 46 represent “SFF” in ASCII.
  • Version - The first nibble of this byte represents the format’s major version, the second nibble represents the format’s minor version.
  • Reserved - Reserved for future expansion. See preamble.

Character data - 96 * 8 bytes

Each block of 8 bytes represents a bitmap describing how to draw a character, where the left most bit in each byte represents the left most column. Each row is represented by a single byte, with the first byte representing the top row.

In its first iteration, the format requires 96 characters to be defined. These represent ASCII codes 0x20 - 0x7E - this is the first 95 characters in the format. Character 96 should be used by a character renderer to represent bytes passed to it, which fall outside defined range. The font designer may choose to represent this with a symbol, or leave it blank.

Supporting tools

Coming soon - a tool to edit Small Font Format fonts, using WinForms on .Net 4.0. However, I don’t expect this to be the de facto editor for Small Font Format fonts - I’d like to rewrite this tool with something that allows for native cross platform use. This may be Python or C++, but will use a true cross-platform GUI toolkit.

This post is licensed under CC BY 4.0 by the author.
Contents