# Darker portable fonts

Six OpenType fonts with TrueType outlines (.ttf), plus matching WOFF2 webfonts:

- Darker Interface: 107 original glyphs
- Darker Compact: 97 original glyphs
- Darker Wide: 96 original glyphs
- A Coverage companion for each of the above

The regular fonts represent the stored high-nibble pattern inside the drawing mask. Coverage fonts represent the entire low-nibble write mask. Together these preserve both source bitmap layers; no runtime colour mapping is baked in. Coverage fonts are useful for reproducing background/outline layers but are not a separate original typeface. The original bitmap bytes and palette-driven rendering remain in the extraction JSON.

Install the TTF files with your usual font manager, or use fonts.css for web pages. WOFF2 contains the same glyphs and metrics. TTF is the TrueType-outline flavour of OpenType; the extension does not mean an older substitute for OpenType. These exports use scalable, axis-aligned pixel outlines rather than an OTB bitmap-only font.

## Size and spacing

1024 units per em, 64 units per source pixel: use **16 px** for original pixel size, or integer multiples of 16 px. Baseline is eight source pixels below the original glyph top origin; line height is 16 pixels. This baseline/line-box convention is an export choice, not a recovered game text-line setting. Original per-glyph vertical offsets and horizontal advances are preserved, including the original font-dependent extra pixel of spacing. Space advances four original pixels. No invented kerning, smoothing curves or replacement characters were added. The required .notdef missing-glyph box is an export addition.

A minimal TrueType program disables grid fitting so automatic hinting does not distort the pixel shapes. Fractional sizes/positions and application rendering can still introduce antialiasing.

## Character encoding

The game uses a custom encoding. Every source glyph byte C is available at **U+E000 + C** in the Unicode Private Use Area. For example, original byte 65 (A) is also U+E041. This mapping preserves every symbol without assigning speculative Unicode meanings.

Confirmed letters, digits and common punctuation additionally map to ordinary Unicode text. The Interface font has additional conventional punctuation mappings. The Compact/Wide fonts replace several ASCII punctuation slots with accented letters or playback symbols, so those slots are deliberately not mapped as ASCII. Extra accented letters and symbols remain accessible through their Private Use addresses pending a complete semantic mapping. Unmapped characters show .notdef or application fallback, not a fabricated glyph. See manifest.json for exact mappings.

## Provenance and checks

Source: the supplied DOS Darker resource 00/29, extracted in analysis/interface/fonts.json. These are recovered game assets; no new licence or ownership is asserted by this export. OpenType embedding permission bits are left unrestricted as a technical export setting, not a licence grant.

Build: python3 tools/export_portable_fonts.py (fontTools, Brotli and Pillow).

The build checks every glyph in both layers through FreeType from the saved TTF at 16 px: 600 exact pixel and advance comparisons. It reloads WOFF2 and checks character mappings and metrics. The original bitmap decoder separately passed 1,200 native x86 glyph/alignment comparisons. The original glyphs, not .notdef, are counted in these totals.

Format references: https://learn.microsoft.com/typography/opentype/spec/otff and https://fonttools.readthedocs.io/en/latest/ttLib/ .
