Game Boy Color Font

The Game Boy Color has no built-in text font, just as the Game Boy has none. Text is drawn from ordinary tiles: a font is a set of glyph tiles loaded into video RAM, and printing a character writes that glyph's tile index into a background cell. What the Color adds is colour: each printed cell chooses a background palette through the attribute map, so text can be any of the machine's colours.

Game Boy Color Font

Overview

A glyph is a tile, and a font is a run of glyph tiles in tile order, usually starting at the space character. To show a string the program looks up each character's glyph index and writes it into the tile map at the cursor cell, then advances. Because a glyph is just a tile, it draws through the same tile data and palettes as the rest of the picture.

PropertyValue
ROM fontNone
Glyph size8 × 8 pixels (one tile)
Glyph depth2 bits a pixel
ColourA background palette per cell

Glyph format

Each glyph is one 8×8 tile, sixteen bytes, two bits a pixel, the same tile format the background uses. A one-bit source font, one byte a row, is expanded into the two-bit tile as it loads, the set bits taking the ink colour index and the clear bits the paper. So a font is a small tile atlas, one tile a character.

Loading a font

The glyph tiles are copied into video RAM tile data, into whichever bank the text will draw from, before any text appears. A common layout places the glyphs so their tile indices line up with the character codes, so printing is a direct write of the character's code into the map. Two banks are available, so a large font or several fonts can be resident at once.

Colouring text

Each printed cell carries an attribute in the second video RAM bank that picks one of the eight background palettes. Colours zero to three of that palette are the shades the glyph's two-bit pixels show, so setting the palette of a cell recolours the character there. A heading, a highlight or a two-tone label is a matter of choosing the palette per cell as the text is written.