File format · .f09
DOS Screen Font Repair (CP437, EGA/VGA Bitmap Fonts)
DOS 9-pixel screen fonts (CP437, EGA/VGA bitmap fonts) explained: structure, corruption causes, recovery of glyph bitmaps from legacy software, and repair
DOS screen fonts—the bitmap typefaces baked into the ROM of IBM PC-compatible display adapters—defined the visual character of personal computing throughout the 1980s and early 1990s. The most iconic of these is the Code Page 437 (CP437) character set, which remains the default font rendered by modern PCs during the earliest stages of boot, before operating systems load their own scalable typefaces. When legacy applications, retro-computing projects, or specialized industrial systems rely on these bitmap fonts, damage to the font files or memory images can result in unreadable text, missing glyphs, or system crashes.
What Are DOS Screen Fonts?
DOS screen fonts are fixed-width, fixed-height bitmap fonts. Unlike modern scalable outline fonts (such as TrueType or PostScript Type 1 fonts), which define character shapes using mathematical curves and vectors, bitmap fonts explicitly define the exact grid of pixels (the "glyph") used to draw each character at a specific size.
The original IBM PC and its successors stored these fonts directly in the Read-Only Memory (ROM) of their display adapters. According to hardware specifications, these fonts varied in size depending on the graphics card:
- MDA (Monochrome Display Adapter): Used a 9×14 pixel-per-character font.
- CGA (Color Graphics Adapter): Used an 8×8 pixel-per-character font.
- EGA (Enhanced Graphics Adapter): Used an 8×14 pixel-per-character font (and included an 8×8 version for CGA backward compatibility).
- VGA (Video Graphics Array): Used a 9×16 pixel-per-character font.
The "9-pixel" width characteristic of MDA and VGA fonts refers to the fact that the standard 8-bit character cell was padded with a 9th column. For standard alphanumeric characters, this 9th column was left blank, providing a visual spacer between characters. For line-drawing characters (such as those heavily used in DOS text-mode user interfaces), the 9th column duplicated the 8th column, allowing for seamless continuous borders and boxes.
Structure and Technical Facts
The foundational character set for these fonts is Code Page 437 (also known as OEM-US, OEM 437, PC-8, or MS-DOS Latin US). It includes standard printable ASCII characters, accented letters, Greek symbols, and iconic line-drawing elements.
In a DOS text mode environment, each character cell on the screen is mapped to an 8-bit code point, allowing for 256 distinct characters. In standard ASCII, code points 0 through 31 are reserved for non-graphical control characters (like "bell" or "carriage return"). However, in the CP437 ROM, all 256 code points are assigned graphical glyphs, allowing DOS software to utilize the control character range for visual icons like hearts, spades, and smiley faces.
When these ROM fonts are extracted or distributed as files, they typically take the form of raw binary data. A standard 8×16 VGA font file, for example, consists of exactly 4,096 bytes. This data is structured as an array of 256 sequential character definitions. Because each character is 16 rows tall and 1 byte (8 bits) wide, each character requires 16 bytes of data (16 × 1 = 16). Multiplying this by the 256 available code points yields the total file size (16 × 256 = 4,096 bytes). The 9th pixel column is typically not stored in the binary file; instead, the video hardware's text-mode controller automatically generates it based on the specific character code being rendered.
Why DOS Font Files Become Corrupt
Because raw DOS font files are simple, uncompressed binary arrays, they are susceptible to several forms of data corruption:
- Incomplete Extraction: When hobbyists or developers extract fonts from physical ROM chips or dump video memory, an interruption or a faulty read can result in a truncated file. A file that is even a few bytes short will cause the character mapping to shift, rendering text as gibberish.
- Improper Encoding Transfer: Raw binary font data is sometimes mistakenly transferred through text-based channels (like email or certain FTP modes) that interpret the bytes as text. This can trigger unwanted character encoding conversions (such as UTF-8 or CP1252 translation), permanently altering the binary bitstream.
- Disk Degradation: Many legacy font files are stored on aging floppy disks. Magnetic degradation over decades can cause bit rot—where individual bits flip from 0 to 1 or vice versa—resulting in distorted character shapes.
- Memory Corruption: In modern retro-gaming or emulation environments, a crash or improper memory dump can capture a font table from RAM that has already been overwritten or modified by other software.
What Data Can Be Recovered?
In most cases, the structural simplicity of DOS bitmap fonts makes partial or full recovery highly likely.
If a font file is truncated, the missing characters are simply absent from the end of the file. The existing characters remain perfectly intact and can be salvaged. If individual bits have flipped due to media degradation, the overall shape of the affected character is usually still recognizable, allowing our technicians to manually repair the pixel grid by restoring the correct bit values. If a file has been subjected to unwanted text encoding conversion, the original binary stream can often be reconstructed by reversing the encoding mathematically.
How Recovery Works
Recovering a DOS screen font involves analyzing the binary structure at the byte level. Our process typically follows these steps:
- File Signature and Size Verification: We first check the file size. A standard 8×16 font should be 4,096 bytes. An 8×14 EGA font should be 3,584 bytes. An 8×8 CGA font should be 2,048 bytes. If the file size does not match a known dimension, we know the file is either truncated or padded with unrelated data.
- Hexadecimal Analysis: We examine the file in a hex editor to look for patterns. Because font data consists of rows of pixels, it often has repeating or visually distinct binary patterns. If we see ASCII text or other non-pixel data mixed into the file, we isolate and remove it.
- Grid Reconstruction: We load the raw binary data into specialized font-editing software, mapping it to the correct grid dimensions (e.g., 8 pixels wide by 16 pixels tall). This allows us to visually verify which glyphs survived intact and which sustained damage.
- Pixel-Level Repair: For damaged glyphs, we compare the corrupted character against known references (like the standard CP437 specification) to manually redraw the missing pixels, ensuring the repaired character matches its intended historical appearance.
- Padding and Export: Once the 256-character array is restored, we export the file back into its raw binary format, ready to be loaded into an emulator, flashed to a ROM chip, or utilized by legacy software.
Frequently Asked Questions
What is the difference between a bitmap font and an outline font?
Bitmap fonts define characters as a specific grid of pixels at a fixed size. Outline fonts (like PostScript Type 1 or TrueType) define characters using mathematical curves, allowing them to be scaled to any size without losing fidelity.
Why do some DOS characters look wider than others?
In MDA and VGA text modes, standard characters are 8 pixels wide with a blank 9th pixel column for spacing. Line-drawing characters utilize that 9th column to connect seamlessly to adjacent characters, making them appear 9 pixels wide.
Can a corrupted font file crash a DOS application?
Yes. If an application attempts to load a font file that is improperly sized or contains unexpected data, it can cause memory allocation errors, resulting in a system crash or a program exit to the command prompt.
Are DOS fonts still used today?
Yes. Beyond retro-computing and video game emulation, many embedded systems, industrial machinery, and point-of-sale terminals still rely on simple bitmap fonts for their low processing overhead and high legibility on low-resolution displays.
If you have a corrupted DOS font file, a damaged video ROM dump, or an unreadable legacy bitmap typeface, we can help. Our team specializes in analyzing and reconstructing raw binary font data. Send us your file for a free evaluation, and we will assess the extent of the damage and outline exactly what can be recovered.
Send us your .f09 file for a free evaluation
Our recovery engineers will tell you exactly what can be recovered — at no cost. There is no charge if we cannot recover your data.
Start a free evaluation