◈ lib · teleprinter
The Teleprinter
A dependency-free bitmap-font utility for character art. The full laboratory adds image sampling and coverage matching. Each cell takes the glyph whose measured ink coverage is nearest its brightness — after the sheet is stretched to its own tonal range — so the result reads as tone rather than as texture. Ships with a 5x7 bitmap face, so it needs no fonts and runs anywhere, including a worker.
A working specimen.
Each source step maps to one glyph. This example uses evenly spaced brightness bands; the full lab measures glyph coverage and normalizes the image.
const ramp = " .:-=+*#%@"; const brightness = 0.65; // 0–1 source luminance const glyph = ramp[Math.round(brightness * (ramp.length - 1))]; drawText(rgba, width, height, glyph, 20, 20, 4, [180,225,185,255]);
The installable item is the bitmap-font utility shown here. The full laboratory adds image sampling, tonal normalization and character selection.
Minimal example · selected parameters
Mount <canvas width="600" height="360"></canvas> before running this code. Run pixel-buffer functions in a worker for larger outputs.
import { drawText } from '@/lib/render/pixelFont';
const width = 600, height = 360;
const rgba = new Uint8ClampedArray(width * height * 4);
// Transparent background; supply your own ground if desired.
drawText(rgba, width, height, "MATERIAL / 01", 20, 144, 6, [180,225,185,255]);
document.querySelector('canvas').getContext('2d').putImageData(new ImageData(rgba,width,height),0,0);Copies component source and tokens directly into your repository with requirements listed for this item: no additional npm dependencies beyond the host framework.
Open-source under MIT. We preserve the source header comment, and invite you to credit the archive on your project's /about, /colophon, or footer. Display our Archival Colophon Seal or copy a citation snippet below. Sites displaying the seal are welcome to submit to our Federation Showcase!
Source
lib/render/pixelFont.ts
Registry item: /r/teleprinter.json