Skip to content

Instantly share code, notes, and snippets.

@buzztiaan
Created April 12, 2018 18:10
Show Gist options
  • Save buzztiaan/5a3fa543224ce180ea26c60c2348486c to your computer and use it in GitHub Desktop.
Save buzztiaan/5a3fa543224ce180ea26c60c2348486c to your computer and use it in GitHub Desktop.
a 4x4 pixels font
// 4x4 pixel font, horrible, unreadable :)
const int CHAR_WIDTH = 4;
const int CHAR_HEIGHT = 4;
byte halffont[95][4] = { {0,0,0,0}, //space
{0,0,0,0}, // !
{0,0,0,0}, // "
{0,0,0,0}, // #
{0,0,0,0}, // $
{0,0,0,0}, // %
{0,0,0,0}, // &
{0,0,0,0}, // '
{0x1,0x2,0x2,0x1}, // (
{0x2,0x1,0x1,0x2}, // )
{0,0,0,0}, // *
{0,0,0,0}, // +
{0,0,0x1,0x2}, // ,
{0,0,0x6,0}, // -
{0,0,0,0x2}, // .
{0x0,0x1,0x2,0x4}, // /
{0x7,0x5,0x5,0x7}, // 0
{0x2,0x6,0x2,0x2}, // 1
{0x6,0x1,0x2,0x7}, // 2
{0x6,0x3,0x1,0x6}, // 3
{0x1,0x5,0x7,0x1}, // 4
{0x7,0x6,0x1,0x6}, // 5
{0x7,0x4,0x7,0x7}, // 6
{0x7,0x1,0x2,0x2}, // 7
{0x7,0x5,0x7,0x7}, // 8
{0x7,0x7,0x1,0x7}, // 9
{0,0x2,0,0x2}, // :
{0,0,0,0}, // ;
{0,0,0,0}, // <
{0,0,0,0}, // =
{0,0,0,0}, // >
{0,0,0,0}, // ?
{0,0,0,0}, // @
{0x2,0x5,0x7,0x5}, // A
{0x6,0x6,0x5,0x6}, // B
{0x3,0x4,0x4,0x3}, // C
{0x6,0x5,0x5,0x6}, // D
{0x7,0x6,0x4,0x7}, // E
{0x7,0x4,0x6,0x4}, // F
{0x3,0x4,0x5,0x2}, // G
{0x5,0x5,0x7,0x5}, // H
{0x7,0x2,0x2,0x7}, // I
{0x1,0x1,0x5,0x2}, // J
{0x5,0x6,0x5,0x5}, // K
{0x4,0x4,0x4,0x7}, // L
{0x7,0x7,0x5,0x5}, // M
{0x5,0x7,0x7,0x5}, // N
{0x2,0x5,0x5,0x2}, // O
{0x6,0x5,0x6,0x4}, // P
{0x2,0x5,0x5,0x3}, // Q
{0x6,0x5,0x6,0x5}, // R
{0x3,0x6,0x1,0x6}, // S
{0x7,0x2,0x2,0x2}, // T
{0x5,0x5,0x5,0x3}, // U
{0x5,0x5,0x5,0x2}, // V
{0x5,0x5,0x7,0x7}, // W
{0x5,0x2,0x2,0x5}, // X
{0x5,0x2,0x2,0x2}, // Y
{0x7,0x2,0x4,0x7}, // Z
{0x3,0x2,0x2,0x3}, // [
{0,0x4,0x2,0x1}, //
{0x6,0x2,0x2,0x6}, // ]
{0,0,0,0}, // ^
{0,0,0,0}, // _
{0,0,0,0}, // `
{0x2,0x5,0x7,0x5}, // a
{0x6,0x6,0x5,0x6}, // b
{0x3,0x4,0x4,0x3}, // c
{0x6,0x5,0x5,0x6}, // d
{0x7,0x6,0x4,0x7}, // e
{0x7,0x4,0x6,0x4}, // f
{0x3,0x4,0x5,0x2}, // g
{0x5,0x5,0x7,0x5}, // h
{0x7,0x2,0x2,0x7}, // i
{0x1,0x1,0x5,0x2}, // j
{0x5,0x6,0x5,0x5}, // k
{0x4,0x4,0x4,0x7}, // l
{0x7,0x7,0x5,0x5}, // m
{0x5,0x7,0x7,0x5}, // n
{0x2,0x5,0x5,0x2}, // o
{0x6,0x5,0x6,0x4}, // p
{0x2,0x5,0x5,0x3}, // q
{0x6,0x5,0x6,0x5}, // r
{0x3,0x6,0x1,0x6}, // s
{0x7,0x2,0x2,0x2}, // t
{0x5,0x5,0x5,0x3}, // u
{0x5,0x5,0x5,0x2}, // v
{0x5,0x5,0x7,0x7}, // w
{0x5,0x2,0x2,0x5}, // x
{0x5,0x2,0x2,0x2}, // y
{0x7,0x2,0x4,0x7}, // z
{0x1,0x2,0x6,0x1}, // {
{0x2,0x2,0x2,0x2}, // |
{0x4,0x2,0x3,0x4}, // }
{0,0,0,0}, // ~
};
@buzztiaan
Copy link
Author

Example of the font in use ;

clock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment