Plain text ($01)
GIF89a provided a way to store text that the decoder draws onto the image itself, instead of keeping it as pixels. The idea never caught on: almost no browser or graphics program supports it.
Structure
| Bytes | Field |
|---|---|
| 0-1 | 21 01: extension, plain text label |
| 2 | fixed block length: always 0C (12) |
| 3-4 | text grid left position |
| 5-6 | top position |
| 7-8 | grid width in pixels |
| 9-10 | grid height in pixels |
| 11 | character cell width in pixels |
| 12 | character cell height |
| 13 | text color index (global palette) |
| 14 | background color index |
| then | ASCII text sub-blocks, 00 terminator |
The text fills the grid of cells left to right and top to bottom. For example an 80 × 16 pixel grid with 8 × 16 cells holds one row of 10 characters.
Example
21 01 0C
00 00 00 00 left 0, top 0
50 00 10 00 grid 80 × 16
08 10 cell 8 × 16
02 01 text in color 2 (black) on background 1 (white)
06 73 65 6D 6D 69 78 sub-block: "semmix"
00 terminator
Why it does not work
- No typeface. The specification does not say which font to use. Every decoder would need its own, and the result would differ in every program.
- ASCII only. No accented letters or other alphabets.
- An easier alternative. Text drawn into the image pixels looks the same everywhere and asks nothing of the decoder.
The extension is worth knowing only to skip it correctly (see extension blocks). The specification treats it as a rendering block, so a graphic control block may precede it, just as for an image.