/// A glyph's pen: its character and its strokes, one string per stroke, cells as row-col tokens. /// /// - A token is one row digit then one column digit over the trimmed bitmap; rows and columns never pass 6. /// - One stroke per string, cells in drawing order, each 4-adjacent to the one before it. /// - Long strokes: start where a hand starts the shape and lift only where a hand lifts. /// - The tables follow `glyphs.rs` order: UPPERS, LOWERS, DIGITS, EXTRAS, SPECIALS. /// - Draft a glyph with `cargo run -p mrlyfont --example pen -- X`, then edit it by hand. /// - The mechanical rules are tests in `paths.rs`; taste is not, so P keeps its one-cell stroke. pub type Pen = (char, &'static [&'static str]); /// The pens of the twenty-six uppers. #[rustfmt::skip] pub const UPPERS: &[Pen] = &[ ('A', &[ "40 30 20 10 00 01 02 03 04 14 24 34 44", "21 22 23", ]), ('B', &[ "00 10 20 30 40 41 42 43 44 34 24 23 22 21", ]), ('C', &[ "44 43 42 41 40 30 20 10 00 01 02 03 04", ]), ('D', &[ "23 22 21 20", "30 40", "41 42 43 44", "34 24 14 04", ]), ('E', &[ "44 43 42 41 40 30 20 10 00 01 02 03 04", "21 22 23 24", ]), ('F', &[ "40 30 20 10 00 01 02 03 04", "21 22 23 24", ]), ('G', &[ "22 23 24 34 44 43 42 41 40 30 20 10 00 01 02 03 04", ]), ('H', &[ "40 30 20 10 00", "44 34 24 14 04", "21 22 23", ]), ('I', &[ "40 41 42 43 44", "32 22 12 02 03 04", "00 01", ]), ('J', &[ "22 21 20 30 40 41 42 43 44 34 24 14 04 03 02 01 00", ]), ('K', &[ "40 30 20 10 00", "44 43 42 32 22 12 02 03 04", "21", ]), ('L', &[ "00 10 20 30 40", "41 42 43 44", ]), ('M', &[ "40 30 20 10 00", "01 02 03 04", "14 24 34 44", "12 22 32 42", ]), ('N', &[ "40 30 20 10 00 01 02 12 22 32 42 43 44 34 24 14 04", ]), ('O', &[ "40 30 20 10 00", "01 02 03 04", "14 24 34 44", "43 42 41", ]), ('P', &[ "40 30 20 10 00", "01 02 03 04", "14", "24 23 22 21", ]), ('Q', &[ "44 34 24 14 04 03 02 01 00 10 20 21 22 23", ]), ('R', &[ "40 30 20 10 00", "01 02 03 04", ]), ('S', &[ "40 41 42 43 44 34 24 23 22 21 20 10 00 01 02 03 04", "32", "12", ]), ('T', &[ "42 32 22 12 02 03 04", "00 01", ]), ('U', &[ "00 10 20 30 40 41 42 43 44 34 24 14 04", ]), ('V', &[ "00 10 20 30 40 41 42 43 44 34 24 14 04", "32 22 23", "21", ]), ('W', &[ "00 10 20 30 40 41 42 43 44 34 24 14 04", "32 22 12 02", ]), ('X', &[ "41 40 30 20 10 00 01 02 03 04 14 24 34 44 43 42 32", "21 22 23", "12", ]), ('Y', &[ "00 10 20", "21 22 23", "04 14 24", "34 44 43 42 41 40", ]), ('Z', &[ "44 43 42 41 40 30 20 21 22 23 24 14 04 03 02 01 00", "32", "12", ]), ]; /// The pens of the twenty-six lowers. #[rustfmt::skip] pub const LOWERS: &[Pen] = &[ ('a', &[ "30 20 10", "34 24 14", "21 22 23", "01 02 03", ]), ('b', &[ "41 42 43", "30 20 10", "34 24 23 22 21", ]), ('c', &[ "41 42 43", "30 20 10", "01 02 03", ]), ('d', &[ "41 42 43", "30 20 21 22 23 24 14", "34", ]), ('e', &[ "41 42 43", "30 20 10", "21 22 23 24", "01 02 03", ]), ('f', &[ "30 20 10", "21 22 23 24", "01 02 03", ]), ('g', &[ "41 42 43", "30 20 10", "34 24 23 22", "01 02 03", ]), ('h', &[ "30 20 10", "34 24 14", "21 22 23", ]), ('i', &[ "40 41 42", "31 21 11 01 02", "00", ]), ('j', &[ "41 42 43", "30 20 21 22", "34 24 14", "01 02 03", ]), ('k', &[ "43 42 32 22 12 02 03", "30 20 10", "21", ]), ('l', &[ "41 42 43", "30 20 10", ]), ('m', &[ "42 32 22 12 02 03", "30 20 10", "34 24 14", "01", ]), ('n', &[ "43 42 32 22 12 02 01", "30 20 10", "34 24 14", ]), ('o', &[ "41 42 43", "30 20 10", "34 24 14", "01 02 03", ]), ('p', &[ "30 20 10", "21 22 23 24 14", "01 02 03", ]), ('q', &[ "34 24 14", "23 22 21 20 10", "01 02 03", ]), ('r', &[ "30 20 10", "01 02 03", ]), ('s', &[ "41 42 43", "32 22 12 02 03", "34 24 23", "21 20 10", "01", ]), ('t', &[ "41 31 21 11 01 02", "00", ]), ('u', &[ "41 42 43", "30 20 10", "34 24 14", ]), ('v', &[ "41 42 43", "30 20 10", "32 22 23 24 14", "34", "21", ]), ('w', &[ "41 42 43", "30 20 10", "32 22 12 02", "34 24 14", ]), ('x', &[ "41 42 43", "30 20 10", "32 22 12 02 03", "34 24 14", "21", "23", "01", ]), ('y', &[ "41 42 43", "34 24 14", "23 22 21 20 10", ]), ('z', &[ "41 42 43", "30 20 21 22 23 24 14", "12 02 03", "32", "01", ]), ]; /// The pens of the ten digits. #[rustfmt::skip] pub const DIGITS: &[Pen] = &[ ('0', &[ "40 30 20 10 00 01 02 03 04 14 24 34 44 43 42 41", "22", ]), ('1', &[ "40 41 42 43 44", "32 22 12 02 01 00", ]), ('2', &[ "44 43 42 41 40 30 20 21 22 23 24 14 04 03 02 01 00", ]), ('3', &[ "40 41 42 43 44 34 24 14 04 03 02 01 00", "20 21 22 23", ]), ('4', &[ "44 34 24 14 04", "23 22 21 20 10 00", ]), ('5', &[ "40 41 42 43 44 34 24 23 22 21 20 10 00 01 02 03 04", ]), ('6', &[ "04 03 02 01 00 10 20 30 40 41 42 43 44 34 24 23 22 21", ]), ('7', &[ "44 34 24 14 04 03 02 01 00", "20 21 22 23", ]), ('8', &[ "14 04 03 02 01 00 10 20 21 22 23 24 34 44 43 42 41 40 30", ]), ('9', &[ "40 41 42 43 44 34 24 14 04 03 02 01 00 10 20 21 22 23", ]), ]; /// The pens of the punctuation, symbol and arrow glyphs. #[rustfmt::skip] pub const EXTRAS: &[Pen] = &[ (' ', &[]), ('.', &[ "40", ]), (',', &[ "40", "31", ]), ('\'', &[ "10 00", ]), ('`', &[ "11", "00", ]), ('"', &[ "10 00", "12 02", ]), (':', &[ "30", "10", ]), (';', &[ "40", "31", "11", ]), ('!', &[ "20 10 00", "40", ]), ('\u{00a1}', &[ "40 30 20", "00", ]), ('?', &[ "22 23 24 14 04 03 02 01 00", "42", ]), ('\u{00bf}', &[ "44 43 42 41 40 30 20 21 22", "02", ]), ('^', &[ "20", "24", "11", "13", "02", ]), ('_', &[ "40 41 42 43 44", ]), ('|', &[ "40 30 20 10 00", ]), ('\\', &[ "44", "33", "22", "11", "00", ]), ('/', &[ "40", "31", "22", "13", "04", ]), ('<', &[ "42", "31", "20", "11", "02", ]), ('>', &[ "40", "31", "22", "11", "00", ]), ('\u{2190}', &[ "31 21 11", "22 23 24", "42", "20", "02", ]), ('\u{2191}', &[ "42 32 22 12 02", "20", "24", "11", "13", ]), ('\u{2192}', &[ "33 23 13", "20 21 22", "42", "24", "02", ]), ('\u{2193}', &[ "42 32 22 12 02", "31", "33", "20", "24", ]), ('-', &[ "20 21 22", ]), ('\u{2014}', &[ "20 21 22 23 24", ]), ('\u{00b7}', &[ "20", ]), ('=', &[ "30 31 32 33 34", "10 11 12 13 14", ]), ('+', &[ "42 32 22 12 02", "20 21", "23 24", ]), ('\u{2212}', &[ "20 21 22 23 24", ]), ('\u{00d7}', &[ "40", "44", "31", "33", "22", "11", "13", "00", "04", ]), ('\u{00f7}', &[ "20 21 22 23 24", "42", "02", ]), ('*', &[ "40", "42", "44", "31", "33", "20", "22", "24", "11", "13", "00", "02", "04", ]), ('#', &[ "41 31 21 11 01", "43 33 23 13 03", "30", "32", "34", "10", "12", "14", ]), ('%', &[ "40", "44", "31", "22", "13", "00", "04", ]), ('~', &[ "33", "20", "22", "24", "11", ]), ('&', &[ "43 42 41 40 30", "10 00 01 02 12", "32", "34", "21", ]), ('(', &[ "40 30 20", "62", "51", "11", "02", ]), (')', &[ "42 32 22", "60", "51", "11", "00", ]), ('[', &[ "62 61 60 50 40 30 20 10 00 01 02", ]), (']', &[ "60 61 62 52 42 32 22 12 02 01 00", ]), ('{', &[ "51 41", "21 11", "62", "30", "02", ]), ('}', &[ "51 41", "21 11", "60", "32", "00", ]), ]; /// The pens of the four seven-row specials. #[rustfmt::skip] pub const SPECIALS: &[Pen] = &[ ('$', &[ "62 52 42 32 22 12 02", "50 51", "53 54 44 34 33", "31 30 20 10 11", "13 14", ]), ('@', &[ "66 65 64 63 62 61 60 50 40 30 20 10 00 01 02 03 04 05 06 16 26 36 46 45 44 43 42 32 22 23 24 34", ]), ('\u{00a9}', &[ "44 43 42 32 22 23 24", "60 50 40 30 20 10 00 01 02 03 04 05 06 16 26 36 46 56 66 65 64 63 62 61", ]), ('\u{00ae}', &[ "42 32 22 23 24", "60 50 40 30 20 10 00 01 02 03 04 05 06 16 26 36 46 56 66 65 64 63 62 61", ]), ]; /// Returns every pen in font order: uppers, lowers, digits, extras, specials. pub fn all() -> Vec { [UPPERS, LOWERS, DIGITS, EXTRAS, SPECIALS] .into_iter() .flatten() .copied() .collect() }