Files
Iisyourdad b7e64c79b4 Add imaging/document primitives: PNG codec, rasterizer, GIF, PDF
- Pure-JS PNG decode (grey/RGB/palette/alpha) + RGBA encode, CRC-checked;
  decode verified byte-identical with ImageMagick
- Software rasterizer: shapes, arrows, blur, highlight, magnify, tooltip,
  number badges, cursor, bitmap text (vendored public-domain font8x8),
  crop/resize, focused-view rendering
- GIF89a encoder with LZW (cross-validated pixel-for-pixel against
  ImageMagick decode) + NETSCAPE looping
- Minimal PDF 1.4 writer: pages, fonts, rects, images, outlines, valid
  xref; rendering validated under Ghostscript
- 12 imaging workflow tests (35 total)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:48:57 -05:00

142 lines
4.4 KiB
JavaScript

'use strict';
/**
* 8x8 monochrome bitmap font (ASCII 0-127), public domain.
* Generated from vendor/font8x8/font8x8_basic.h
* (Daniel Hepper / Marcel Sondaar / IBM public-domain VGA fonts).
* Each glyph is 8 bytes; bit n of byte y is pixel (x=n, y).
*/
const FONT8X8 = [
[0,0,0,0,0,0,0,0], // 0x0
[0,0,0,0,0,0,0,0], // 0x1
[0,0,0,0,0,0,0,0], // 0x2
[0,0,0,0,0,0,0,0], // 0x3
[0,0,0,0,0,0,0,0], // 0x4
[0,0,0,0,0,0,0,0], // 0x5
[0,0,0,0,0,0,0,0], // 0x6
[0,0,0,0,0,0,0,0], // 0x7
[0,0,0,0,0,0,0,0], // 0x8
[0,0,0,0,0,0,0,0], // 0x9
[0,0,0,0,0,0,0,0], // 0xa
[0,0,0,0,0,0,0,0], // 0xb
[0,0,0,0,0,0,0,0], // 0xc
[0,0,0,0,0,0,0,0], // 0xd
[0,0,0,0,0,0,0,0], // 0xe
[0,0,0,0,0,0,0,0], // 0xf
[0,0,0,0,0,0,0,0], // 0x10
[0,0,0,0,0,0,0,0], // 0x11
[0,0,0,0,0,0,0,0], // 0x12
[0,0,0,0,0,0,0,0], // 0x13
[0,0,0,0,0,0,0,0], // 0x14
[0,0,0,0,0,0,0,0], // 0x15
[0,0,0,0,0,0,0,0], // 0x16
[0,0,0,0,0,0,0,0], // 0x17
[0,0,0,0,0,0,0,0], // 0x18
[0,0,0,0,0,0,0,0], // 0x19
[0,0,0,0,0,0,0,0], // 0x1a
[0,0,0,0,0,0,0,0], // 0x1b
[0,0,0,0,0,0,0,0], // 0x1c
[0,0,0,0,0,0,0,0], // 0x1d
[0,0,0,0,0,0,0,0], // 0x1e
[0,0,0,0,0,0,0,0], // 0x1f
[0,0,0,0,0,0,0,0], // " "
[24,60,60,24,24,0,24,0], // "!"
[54,54,0,0,0,0,0,0], // "\""
[54,54,127,54,127,54,54,0], // "#"
[12,62,3,30,48,31,12,0], // "$"
[0,99,51,24,12,102,99,0], // "%"
[28,54,28,110,59,51,110,0], // "&"
[6,6,3,0,0,0,0,0], // "'"
[24,12,6,6,6,12,24,0], // "("
[6,12,24,24,24,12,6,0], // ")"
[0,102,60,255,60,102,0,0], // "*"
[0,12,12,63,12,12,0,0], // "+"
[0,0,0,0,0,12,12,6], // ","
[0,0,0,63,0,0,0,0], // "-"
[0,0,0,0,0,12,12,0], // "."
[96,48,24,12,6,3,1,0], // "/"
[62,99,115,123,111,103,62,0], // "0"
[12,14,12,12,12,12,63,0], // "1"
[30,51,48,28,6,51,63,0], // "2"
[30,51,48,28,48,51,30,0], // "3"
[56,60,54,51,127,48,120,0], // "4"
[63,3,31,48,48,51,30,0], // "5"
[28,6,3,31,51,51,30,0], // "6"
[63,51,48,24,12,12,12,0], // "7"
[30,51,51,30,51,51,30,0], // "8"
[30,51,51,62,48,24,14,0], // "9"
[0,12,12,0,0,12,12,0], // ":"
[0,12,12,0,0,12,12,6], // ";"
[24,12,6,3,6,12,24,0], // "<"
[0,0,63,0,0,63,0,0], // "="
[6,12,24,48,24,12,6,0], // ">"
[30,51,48,24,12,0,12,0], // "?"
[62,99,123,123,123,3,30,0], // "@"
[12,30,51,51,63,51,51,0], // "A"
[63,102,102,62,102,102,63,0], // "B"
[60,102,3,3,3,102,60,0], // "C"
[31,54,102,102,102,54,31,0], // "D"
[127,70,22,30,22,70,127,0], // "E"
[127,70,22,30,22,6,15,0], // "F"
[60,102,3,3,115,102,124,0], // "G"
[51,51,51,63,51,51,51,0], // "H"
[30,12,12,12,12,12,30,0], // "I"
[120,48,48,48,51,51,30,0], // "J"
[103,102,54,30,54,102,103,0], // "K"
[15,6,6,6,70,102,127,0], // "L"
[99,119,127,127,107,99,99,0], // "M"
[99,103,111,123,115,99,99,0], // "N"
[28,54,99,99,99,54,28,0], // "O"
[63,102,102,62,6,6,15,0], // "P"
[30,51,51,51,59,30,56,0], // "Q"
[63,102,102,62,54,102,103,0], // "R"
[30,51,7,14,56,51,30,0], // "S"
[63,45,12,12,12,12,30,0], // "T"
[51,51,51,51,51,51,63,0], // "U"
[51,51,51,51,51,30,12,0], // "V"
[99,99,99,107,127,119,99,0], // "W"
[99,99,54,28,28,54,99,0], // "X"
[51,51,51,30,12,12,30,0], // "Y"
[127,99,49,24,76,102,127,0], // "Z"
[30,6,6,6,6,6,30,0], // "["
[3,6,12,24,48,96,64,0], // "\\"
[30,24,24,24,24,24,30,0], // "]"
[8,28,54,99,0,0,0,0], // "^"
[0,0,0,0,0,0,0,255], // "_"
[12,12,24,0,0,0,0,0], // "`"
[0,0,30,48,62,51,110,0], // "a"
[7,6,6,62,102,102,59,0], // "b"
[0,0,30,51,3,51,30,0], // "c"
[56,48,48,62,51,51,110,0], // "d"
[0,0,30,51,63,3,30,0], // "e"
[28,54,6,15,6,6,15,0], // "f"
[0,0,110,51,51,62,48,31], // "g"
[7,6,54,110,102,102,103,0], // "h"
[12,0,14,12,12,12,30,0], // "i"
[48,0,48,48,48,51,51,30], // "j"
[7,6,102,54,30,54,103,0], // "k"
[14,12,12,12,12,12,30,0], // "l"
[0,0,51,127,127,107,99,0], // "m"
[0,0,31,51,51,51,51,0], // "n"
[0,0,30,51,51,51,30,0], // "o"
[0,0,59,102,102,62,6,15], // "p"
[0,0,110,51,51,62,48,120], // "q"
[0,0,59,110,102,6,15,0], // "r"
[0,0,62,3,30,48,31,0], // "s"
[8,12,62,12,12,44,24,0], // "t"
[0,0,51,51,51,51,110,0], // "u"
[0,0,51,51,51,30,12,0], // "v"
[0,0,99,107,127,127,54,0], // "w"
[0,0,99,54,28,54,99,0], // "x"
[0,0,51,51,51,62,48,31], // "y"
[0,0,63,25,12,38,63,0], // "z"
[56,12,12,7,12,12,56,0], // "{"
[24,24,24,0,24,24,24,0], // "|"
[7,12,12,56,12,12,7,0], // "}"
[110,59,0,0,0,0,0,0], // "~"
[0,0,0,0,0,0,0,0] // 0x7f
];
module.exports = { FONT8X8 };