Teletext Font

Text on Teletext is drawn by the SAA5050 character generator. The screen is a grid of 40×25 cells, each a 6-wide, 10-row pattern taken from the chip's ROM. The set holds the alphanumerics, the letters, digits and punctuation, and a bank of 2×3 mosaic block graphics that a cell switches to under a control code. Colour, graphics and double height are chosen along a row by control codes that each take one cell, in eight colours. This is the character generator the BBC Micro drives in MODE 7.

Teletext Fonts

Overview

Each character is a 6×10 cell, six pixels wide and ten rows tall, one of a 40×25 grid of cells that fills the screen. The SAA5050 holds two banks of patterns in ROM: the alphanumerics for text, and the contiguous mosaic graphics for block pictures. A cell shows one or the other, chosen by the graphics control codes that run along the row. There is no bitmap; a page is just a grid of character codes, one byte a cell, and the chip draws the ROM pattern for each.

Character format

A glyph is ten consecutive bytes. The first byte is the top row of the character, the last byte the bottom row. In each byte the low bits are the six pixels, the leftmost the top bit of the cell width, a set bit an ink pixel. The high bits are not part of the pattern and are left clear, so each row uses the same six low bits.

ByteRowBits (left = top bit)
0Top6 pixels of row 0
1–8Middlerows 1 to 8
9Bottom6 pixels of row 9

Alphanumerics

The alphanumerics are the SAA5050 text set: letters, digits and punctuation, codes 32 to 127, each a 6×10 pattern. This is the set a cell shows unless a graphics control code has switched the row to graphics. It is the tool's default Teletext font.

Mosaic graphics

The graphics set is a bank of 2×3 mosaic blocks. Each cell is divided into two columns and three rows, giving six sub-blocks, so sixty four block patterns cover every combination of blocks lit. The set comes in two forms, contiguous, where the blocks fill the cell edge to edge, and separated, where each block is inset with a gap around it. Because the pictures are still just character codes, a mosaic page is drawn and stored exactly like text; a picture is a grid of graphics codes with the row switched to graphics.

SetCellsBlocks
Contiguous graphics2 wide × 3 tall64 patterns, blocks edge to edge
Separated graphics2 wide × 3 tall64 patterns, blocks inset with gaps

Control codes

Attributes are set along a row by control codes, each of which takes one cell. A control code changes the ink colour, switches the row between alphanumerics and graphics, chooses contiguous or separated graphics, or turns on double height, and the change holds for the rest of the row unless another code follows. Because a control code occupies its own cell it shows as a space, so colour and graphics changes cost a character position on the line.

Code groupEffect
Alpha colourink colour, switch to alphanumerics
Graphics colourink colour, switch to graphics
Contiguous / separatedchoose the mosaic form
Double heightdraw the row at twice the cell height

Default font

The tool ships the SAA5050 sets, extracted from the real character ROM, as the Teletext default, in Sprites.Platform.Teletext.Font.DefaultFont. It is a font object of 96 glyphs, codes 32 to 127, in the compact ROM form: each glyph is one line of ten bytes, one byte per pixel row, and the leftmost of the six pixels is the top bit. The platform also carries the range as Sprites.Platform.Teletext.Font.CharStart, 32, and Sprites.Platform.Teletext.Font.CharCount, 96. The default is charset 0, the Alphanumerics set; charset 1 is the contiguous mosaic graphics.

The Teletext alphanumerics character set, 96 glyphs
Alphanumerics (charset 0), the real SAA5050 character ROM, code 32 at the top left running to 127. This is Sprites.Platform.Teletext.Font.DefaultFont.
The Teletext contiguous graphics character set, 96 glyphs
Contiguous mosaic graphics (charset 1), the 2×3 block patterns. See the full definition and code in the library: Sprites.Platform.Teletext.Font.DefaultFont.