Skip to main content

Module legacy_computing

Module legacy_computing 

Source
Expand description

Generated fallback BitmapFonts, embedded when the legacy-computing feature is enabled.

Covers the 10 quadrant block characters, the 60 addressable Unicode “Symbols for Legacy Computing” sextant characters, and the full 256-glyph Braille Patterns block (U+2800–U+28FF). None of these are covered by CP437 (and so not by unscii16 either): quadrants and sextants exist to give retroglyph_core::symbols::quantize_quadrant and retroglyph_core::symbols::quantize_sextant a font that actually renders their glyphs as blocks instead of a CP437 solid-block substitute, and braille is a common terminal-UI density trick with no CP437 equivalent at all. All three repertoires are pure geometry (rectangular quadrants, banded sextants, a 2x4 dot grid), so both fonts below are computed at compile time by a const fn rather than transcribed from an external font file; there is no font asset backing this module and no image/build-script dependency.

This is two BitmapFonts (legacy_computing::blocks::FONT and legacy_computing::braille::FONT), not one: a BitmapFont addresses its glyphs with a u8 index (see BitmapFont::rows, BitmapFont::glyph_index), capping any single font at 256 glyphs. Braille alone needs the full 256, so folding quadrants and sextants into the same font would silently wrap their indices mod 256 and collide with braille glyphs. Splitting at the geometry boundary (block elements vs. braille) keeps every font within that limit with room to spare (70 for legacy_computing::blocks::FONT) instead of splitting mid-repertoire.

Add either or both as FontChain fallbacks alongside a primary CP437 font (e.g. unscii16) to extend a chain’s coverage past CP437:

use retroglyph_window::font::{FontChain, legacy_computing, unscii16};

static FALLBACKS: [retroglyph_window::font::BitmapFont; 2] =
    [legacy_computing::blocks::FONT, legacy_computing::braille::FONT];
let chain = FontChain::new(unscii16::FONT, &FALLBACKS);
let quadrant = chain.resolve('▘').expect("covered by legacy_computing::blocks");
assert_eq!(quadrant.font_index(), 1);
let braille = chain.resolve('\u{2837}').expect("covered by legacy_computing::braille");
assert_eq!(braille.font_index(), 2);

Modules§

blocks
The 10 quadrant block glyphs and 60 addressable sextant glyphs CP437 has no mapping for.
braille
The full 256-glyph Braille Patterns block (U+2800–U+28FF) CP437 has no mapping for.