// Tiny 3x5 Fonts // // (c) 1980, 2025 Mike Koss // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and // associated documentation files (the “Software”), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included in all copies or substantial // portions of the Software. // // There are two fonts in the "Tiny 3x5" family. // // The first is a slightly modified version of the 3x5 font // I created in 1980 for the Apple ][. It is no longer // monospaced as there are some 1 and 2 column symbols here // as well. // // The numbers in this font are also in a blocky rather than // rounded style. I think that improves readability and also // distinguishes numbers from letters more. // // This font uses only square pixels. // // The encoding for each character is: // // [C, I1, I2, ..., In] // // where C is the number of columns of width used by the character // and the indices are the row-major sequential indices into the character // array (starting at zero for the uper left). // // Use the grid editor at https://mckoss.com/labs/models/grid-edit.html // to modify individual letters. TINY_3x5 = [ 5, // Number of rows 33, // ASCII code of first character ('!') [ [1, 0,1,2,4], // 33 '!' [3, 0,2,3,5], // 34 '"' [3, 0,2,3,4,5,6,8,9,10,11,12,14], // 35 '#' [3, 1,2,3,4,6,7,8,10,11,12,13], // 36 '$' [3, 0,2,5,7,9,12,14], // 37 '%' [3, 1,3,5,7,9,11,13,14], // 38 '&' [1, 0, 1], // 39 ''' [2, 1,2,4,6,9], // 40 '(' [2, 0,3,5,7,8], // 41 ')' [3, 3,5,7,9,11], // 42 '*' [3, 4,6,7,8,10], // 43 '+' [2, 7,8], // 44 ',' [3, 6,7,8], // 45 '-' [1, 4], // 46 '.' [3, 2,5,7,10,12], // 47 '/' [3, 0,1,2,3,5,6,8,9,11,12,13,14], // 48 '0' [3, 1,3,4,7,10,12,13,14], // 49 '1' [3, 0,1,2,5,6,7,8,9,12,13,14], // 50 '2' [3, 0,1,2,5,6,7,8,11,12,13,14], // 51 '3' [3, 0,2,3,5,6,7,8,11,14], // 52 '4' [3, 0,1,2,3,6,7,8,11,12,13,14], // 53 '5' [3, 0,1,2,3,6,7,8,9,11,12,13,14], // 54 '6' [3, 0,1,2,5,8,11,14], // 55 '7' [3, 0,1,2,3,5,6,7,8,9,11,12,13,14], // 56 '8' [3, 0,1,2,3,5,6,7,8,11,14], // 57 '9' [1, 1,3], // 58 ':' [2, 3, 7,8], // 59 ';' [3, 2,4,6,10,14], // 60 '<' [3, 3,4,5,9,10,11], // 61 '=' [3, 0,4,8,10,12], // 62 '>' [3, 1,3,5,8,10,13], // 63 '?' [3, 1,3,5,6,7,8,9,13,14], // 64 '@' [3, 1,3,5,6,7,8,9,11,12,14], // 65 'A' [3, 0,1,3,5,6,7,9,11,12,13], // 66 'B' [3, 1,3,5,6,9,11,13], // 67 'C' [3, 0,1,3,5,6,8,9,11,12,13], // 68 'D' [3, 0,1,2,3,6,7,9,12,13,14], // 69 'E' [3, 0,1,2,3,6,7,9,12], // 70 'F' [3, 1,2,3,6,8,9,11,13], // 71 'G' [3, 0,2,3,5,6,7,8,9,11,12,14], // 72 'H' [3, 0,1,2,4,7,10,12,13,14], // 73 'I' [3, 0,1,2,4,7,10,12,13], // 74 'J' [3, 0,2,3,5,6,7,9,11,12,14], // 75 'K' [3, 0,3,6,9,12,13,14], // 76 'L' [3, 0,2,3,4,5,6,7,8,9,11,12,14], // 77 'M' [3, 0,2,3,4,5,6,7,8,9,10,11,12,14], // 78 'N' [3, 1,3,5,6,8,9,11,13], // 79 'O' [3, 0,1,3,5,6,7,9,12], // 80 'P' [3, 1,3,5,6,8,10,14], // 81 'Q' [3, 0,1,3,5,6,7,9,11,12,14], // 82 'R' [3, 1,2,3,7,11,12,13], // 83 'S' [3, 0,1,2,4,7,10,13], // 84 'T' [3, 0,2,3,5,6,8,9,11,12,13,14], // 85 'U' [3, 0,2,3,5,6,8,10,13], // 86 'V' [3, 0,2,3,5,6,7,8,9,10,11,12,14], // 87 'W' [3, 0,2,3,5,7,9,11,12,14], // 88 'X' [3, 0,2,3,5,7,10,13], // 89 'Y' [3, 0,1,2,5,7,9,12,13,14], // 90 'Z' [2, 0,1,2,4,6,8,9], // 91 '[' [3, 0,3,7,10,14], // 92 '\\' [2, 0,1,3,5,7,8,9], // 93 ']' [3, 1,3,5], // 94 '^' [3, 12,13,14], // 95 '_' [2, 0,3], // 96 '`' [3, 4,6,8,9,11,13,14], // 97 'a' [3, 0,3,4,6,8,9,11,12,13], // 98 'b' [3, 4,5,6,9,13,14], // 99 'c' [3, 2,4,5,6,8,9,11,13,14], // 100 'd' [3, 4,6,8,9,10,13,14], // 101 'e' [3, 1,2,4,6,7,8,10,13], // 102 'f' [3, 4,6,8,10,11,12,13], // 103 'g' [3, 0,3,4,6,8,9,11,12,14], // 104 'h' [1, 0,2,3,4], // 105 'i' [2, 1,5,7,8], // 106 'j' [3, 0,3,6,8,9,10,12,14], // 107 'k' [1, 0,1,2,3,4], // 108 'l' [3, 3,4,5,6,7,8,9,11,12,14], // 109 'm' [3, 4,6,8,9,11,12,14], // 110 'n' [3, 4,6,8,9,11,13], // 111 'o' [3, 3,4,6,8,9,10,12], // 112 'p' [3, 4,5,6,8,10,11,14], // 113 'q' [2, 2,4,5,6,8], // 114 'r' [2, 3,4,7,8], // 115 's' [3, 1,3,4,5,7,10,13], // 116 't' [3, 3,5,6,8,9,11,12,13,14], // 117 'u' [3, 3,5,6,8,9,11,13], // 118 'v' [3, 3,5,6,8,9,10,11,12,13,14], // 119 'w' [3, 3,5,7,10,12,14], // 120 'x' [3, 3,5,6,8,10,11,12,13], // 121 'y' [3, 3,4,5,7,8,9,10,12,13,14], // 122 'z' [3, 1,2,4,6,7,10,13,14], // 123 '{' [1, 0,1,3,4], // 124 '|' [3, 0,1,4,7,8,10,12,13], // 125 '}' [3, 2,3,4,5,6] // 126 '~' ] ]; // Tiny 3x5 Bias // // This font expands on the previous one to increase legibility. // It incorporates triagular half-pixels in some letters, as well // as allowing for 4 column characters where needed (like, M and W). // // Thanks you to Redditor u/Stone_Age_Sculptor for suggesting improvements // to "1" and "f". (Jan 2025) TINY_3x5_BIAS = [ 5, // Number of rows 33, // ASCII code of first character ('!') [ [1, 0,1,2,4], // 33 '!' [3,0,2,[3,7],[5,7]], // 34 '"' [3,[0,3],[2,3],3,4,5,6,8,9,10,11,[12,7],[14,7]], // 35 '#' [3,1,[2,5],[3,3],4,[6,1],7,[8,5],10,[11,7],[12,1],13], // 36 '$' [3,0,2,[4,3],5,[6,3],7,[8,7],9,[10,7],12,14], // 37 '%' [3,[0,3],1,[2,5],3,5,[6,1],7,[8,7],9,11,[12,1],13,14], // 38 '&' [1, 0, 1], // 39 ''' [2, [0,3],[1,7],2,4,6,[8,1],[9,5]], // 40 '(' [2, [0,1],[1,5],3,5,7,[8,3],[9,7]], // 41 ')' [3,[3,1],[4,5],[5,3],[6,3],7,[8,7],[9,7],[10,1],[11,5]], // 42 '*' [3, 4,6,7,8,10], // 43 '+' [2,7,[8,3],[9,7]], // 44 ',' [3, 6,7,8], // 45 '-' [1, 4], // 46 '.' [3,[2,3],[4,3],5,[6,3],7,[8,7],9,[10,7],[12,7]], // 47 '/' [3,[0,3],1,[2,5],3,[4,3],5,6,7,8,9,[10,7],11,[12,1],13,[14,7]], // 48 '0' [2,[0,3],1,3,5,7,9], // 49 '1' [3,[0,3],1,[2,5],3,5,[7,3],[8,7],[9,3],[10,7],12,13,14], // 50 '2' [3,[0,3],1,[2,5],5,7,8,11,[12,1],13,[14,7]], // 51 '3' [3, 0,2,3,5,6,7,8,11,14], // 52 '4' [3,0,1,2,3,6,7,[8,5],11,12,13,[14,7]], // 53 '5' [3,[0,3],1,[2,7],3,6,7,[8,5],9,11,[12,1],13,[14,7]], // 54 '6' [3, 0,1,2,5,8,11,14], // 55 '7' [3,[0,3],1,[2,5],3,5,6,7,8,9,11,[12,1],13,[14,7]], // 56 '8' [3,[0,3],1,[2,5],3,5,[6,1],7,8,11,14], // 57 '9' [1, 1,3], // 58 ':' [2,3,7,[8,3],[9,7]], // 59 ';' [3,[4,3],[5,7],[6,3],[7,7],[9,1],[10,5],[13,1],[14,5]], // 60 '<' [3, 3,4,5,9,10,11], // 61 '=' [3,[3,1],[4,5],[7,1],[8,5],[10,3],[11,7],[12,3],[13,7]], // 62 '>' [3,[0,3],1,[2,5],[3,1],5,[7,3],[8,7],[10,7],13], // 63 '?' [3, [0,3],1,[2,5],3,5,6,[7,1],[8,7],9,[11,3],[12,1],13,[14,7]], // 64 '@' [3, [0,3],1,[2,5],3,5,6,7,8,9,11,12,14], // 65 'A' [3, 0,1,[2,5],3,5,6,7,[8,5],9,11,12,13,[14,7]], // 66 'B' [3, [0,3],1,[2,5],3,6,9,[12,1],13,[14,7]], // 67 'C' [3, 0,1,[2,5],3,5,6,8,9,11,12,13,[14,7]], // 68 'D' [3, 0,1,2,3,6,7,9,12,13,14], // 69 'E' [3, 0,1,2,3,6,7,9,12], // 70 'F' [3, [0,3],1,[2,5],3,6,[7,3],8,9,11,[12,1],13,[14,7]], // 71 'G' [3, 0,2,3,5,6,7,8,9,11,12,14], // 72 'H' [3, 0,1,2,4,7,10,12,13,14], // 73 'I' [3, 0,1,2,4,7,10,12,13], // 74 'J' [3, 0,[2,3],3,[4,3],[5,7],6,7,9,[10,1],[11,5],12,[14,1]], // 75 'K' [3, 0,3,6,9,12,13,14], // 76 'L' [4, 0,[1,5],[2,3],3,4,5,6,7,8,[9,1],[10,7],11,12,15,16,19], // 77 'M' [3, 0,2,3,[4,5],5,6,7,8,9,[10,1],11,12,14], // 78 'N' [3, [0,3],1,[2,5],3,5,6,8,9,11,[12,1],13,[14,7]], // 79 'O' [3, 0,1,[2,5],3,5,6,7,[8,7],9,12], // 80 'P' [3,[0,3],1,[2,5],3,5,6,8,9,[10,1],11,[12,1],13,[14,1]], // 81 'Q' [3, 0,1,[2,5],3,5,6,7,[8,7],9,[10,1],[11,5],12,[14,1]], // 82 'R' [3, [0,3],1,[2,5],3,[6,1],7,[8,5],11,[12,1],13,[14,7]], // 83 'S' [3, 0,1,2,4,7,10,13], // 84 'T' [3, 0,2,3,5,6,8,9,11,[12,1],13,[14,7]], // 85 'U' [3, 0,2,3,5,6,8,9,[10,3],[11,7],12,[13,7]], // 86 'V' [4,0,3,4,7,8,[9,3],[10,5],11,12,13,14,15,16,[17,7],[18,1],19], // 87 'W' [3,[0,5],[2,3],[3,1],4,[5,7],7,[9,3],10,[11,5],[12,7],[14,1]], // 88 'X' [3,0,2,3,5,[6,1],7,[8,7],10,13], // 89 'Y' [3,0,1,2,[4,3],[5,7],[6,3],[7,7],9,12,13,14], // 90 'Z' [2, 0,1,2,4,6,8,9], // 91 '[' [3,[0,5],3,[4,5],[6,1],7,[8,5],[10,1],11,[14,1]], // 92 '\' [2, 0,1,3,5,7,8,9], // 93 ']' [2,[0,3],[1,5],[2,7],[3,1]], // 94 '^' [3, 12,13,14], // 95 '_' [2,[0,1],[1,5]], // 96 '`' [3,[6,3],7,[8,5],9,11,[12,1],13,[14,1]], // 97 'a' [3,[0,5],3,6,7,[8,5],9,11,[12,1],13,[14,7]], // 98 'b' [3,[6,3],7,[8,5],9,[12,1],13,[14,7]], // 99 'c' [3,[2,3],5,[6,3],7,8,9,11,[12,1],13,[14,7]], // 100 'd' [3,[6,3],7,[8,5],9,[10,3],[11,7],[12,1],13,[14,7]], // 101 'e' [3,[1,3],2,4,6,7,8,10,13], // 102 'f' [3,[3,3],4,[5,5],6,8,[9,1],10,11,12,13,[14,7]], // 103 'g' [3,[0,5],3,6,7,[8,5],9,11,12,14], // 104 'h' [1,[1,7],[2,3],3,4], // 105 'i' [2,[3,7],[5,3],7,8,[9,7]], // 106 'j' [3,[0,5],3,6,[7,3],[8,7],9,10,12,[13,1],[14,5]], // 107 'k' [1,[0,5],1,2,3,4], // 108 'l' [4,8,[9,5],[10,3],[11,5],12,[13,1],[14,7],15,16,19], // 109 'm' [3,6,7,[8,5],9,11,12,14], // 110 'n' [3,[6,3],7,[8,5],9,11,[12,1],13,[14,7]], // 111 'o' [3,[3,3],4,[5,5],6,8,9,10,[11,7],12], // 112 'p' [3,[3,3],4,[5,5],6,8,[9,1],10,11,14], // 113 'q' [2,4,[5,5],6,8], // 114 'r' [2,[4,3],[5,5],[6,1],[7,5],[8,1],[9,7]], // 115 's' [3,[1,5],4,[6,3],7,[8,7],10,13], // 116 't' [3,6,8,9,11,[12,1],13,[14,7]], // 117 'u' [3,6,8,9,[10,3],[11,7],12,[13,7]], // 118 'v' [4,8,11,12,[13,3],[14,5],15,16,[17,7],[18,1],19], // 119 'w' [3,6,[7,3],8,10,12,[13,7],14], // 120 'x' [3,6,8,[9,1],10,[11,7],[12,3],[13,7]], // 121 'y' [2,4,5,[6,3],[7,7],8,9], // 122 'z' [3,[1,3],2,4,6,7,10,[13,1],14], // 123 '{' [1, 0,1,3,4], // 124 '|' [3,0,[1,5],4,7,8,10,12,[13,7]], // 125 '}' [3,[2,5],[3,3],4,[5,7],[6,1]] // 126 '~' ] ];