Skip to content

Commit

Permalink
Merge pull request #27 from pimoroni/fonts
Browse files Browse the repository at this point in the history
added new small font, default to small font when in pixel doubled mode
  • Loading branch information
lowfatcode authored Oct 20, 2021
2 parents 0c7de5e + 9c563a6 commit 615439a
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions libraries/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,106 @@ namespace picosystem {
};

#ifndef NO_FONT
#ifdef PIXEL_DOUBLE
const uint8_t _default_font[96][9] = {
{0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{1, 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00},
{3, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{3, 0xa0, 0xe0, 0xa0, 0xe0, 0xa0, 0x00, 0x00, 0x00},
{3, 0x40, 0xe0, 0xc0, 0x60, 0xe0, 0x40, 0x00, 0x00},
{3, 0xa0, 0x20, 0x40, 0x80, 0xa0, 0x00, 0x00, 0x00},
{3, 0x60, 0x80, 0xe0, 0xc0, 0x60, 0x00, 0x00, 0x00},
{2, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{2, 0x40, 0x80, 0x80, 0x80, 0x40, 0x00, 0x00, 0x00},
{2, 0x80, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00},
{3, 0x40, 0xe0, 0x40, 0xa0, 0x00, 0x00, 0x00, 0x00},
{3, 0x00, 0x40, 0xe0, 0x40, 0x00, 0x00, 0x00, 0x00},
{1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00},
{3, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00},
{1, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00},
{3, 0x20, 0x20, 0x40, 0x80, 0x80, 0x00, 0x00, 0x00},
{3, 0x60, 0xa0, 0xa0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0x40, 0xc0, 0x40, 0x40, 0xe0, 0x00, 0x00, 0x00},
{3, 0xc0, 0x20, 0xe0, 0x80, 0xe0, 0x00, 0x00, 0x00},
{3, 0xc0, 0x20, 0x60, 0x20, 0xe0, 0x00, 0x00, 0x00},
{3, 0x80, 0xa0, 0xe0, 0x20, 0x20, 0x00, 0x00, 0x00},
{3, 0xe0, 0x80, 0xe0, 0x20, 0xc0, 0x00, 0x00, 0x00},
{3, 0x60, 0x80, 0xe0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0xe0, 0x20, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00},
{3, 0x60, 0xa0, 0xe0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0x60, 0xa0, 0xe0, 0x20, 0xc0, 0x00, 0x00, 0x00},
{1, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00},
{1, 0x00, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00},
{2, 0x00, 0x40, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00},
{3, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00},
{2, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00},
{3, 0xe0, 0x20, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00},
{3, 0x60, 0xe0, 0xe0, 0x80, 0x60, 0x00, 0x00, 0x00},
{3, 0x60, 0xa0, 0xe0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0xc0, 0xa0, 0xe0, 0xa0, 0xe0, 0x00, 0x00, 0x00},
{3, 0x60, 0x80, 0x80, 0x80, 0x60, 0x00, 0x00, 0x00},
{3, 0xc0, 0xa0, 0xa0, 0xa0, 0xe0, 0x00, 0x00, 0x00},
{3, 0x60, 0x80, 0xc0, 0x80, 0xe0, 0x00, 0x00, 0x00},
{3, 0x60, 0x80, 0xe0, 0x80, 0x80, 0x00, 0x00, 0x00},
{3, 0x60, 0x80, 0x80, 0xa0, 0xe0, 0x00, 0x00, 0x00},
{3, 0xa0, 0xa0, 0xe0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0xe0, 0x40, 0x40, 0x40, 0xe0, 0x00, 0x00, 0x00},
{3, 0x60, 0x20, 0x20, 0x20, 0xc0, 0x00, 0x00, 0x00},
{3, 0xa0, 0xa0, 0xc0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0x80, 0x80, 0x80, 0x80, 0xe0, 0x00, 0x00, 0x00},
{3, 0xe0, 0xe0, 0xa0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0xc0, 0xa0, 0xa0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0x60, 0xa0, 0xa0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0xc0, 0xa0, 0xe0, 0x80, 0x80, 0x00, 0x00, 0x00},
{3, 0x60, 0xa0, 0xa0, 0xc0, 0x60, 0x00, 0x00, 0x00},
{3, 0xc0, 0xa0, 0xc0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0x60, 0x80, 0x40, 0x20, 0xc0, 0x00, 0x00, 0x00},
{3, 0xe0, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00},
{3, 0xa0, 0xa0, 0xa0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0xa0, 0xa0, 0xa0, 0xa0, 0x40, 0x00, 0x00, 0x00},
{3, 0xa0, 0xa0, 0xa0, 0xe0, 0xe0, 0x00, 0x00, 0x00},
{3, 0xa0, 0xa0, 0x40, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0xa0, 0xa0, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00},
{3, 0xe0, 0x20, 0x40, 0x80, 0xe0, 0x00, 0x00, 0x00},
{2, 0xc0, 0x80, 0x80, 0x80, 0xc0, 0x00, 0x00, 0x00},
{3, 0x80, 0x80, 0x40, 0x20, 0x20, 0x00, 0x00, 0x00},
{2, 0xc0, 0x40, 0x40, 0x40, 0xc0, 0x00, 0x00, 0x00},
{3, 0x00, 0x40, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00},
{3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00},
{2, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00},
{3, 0x00, 0x60, 0xa0, 0xa0, 0x60, 0x00, 0x00, 0x00},
{3, 0x80, 0xc0, 0xa0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0x00, 0x60, 0x80, 0x80, 0x60, 0x00, 0x00, 0x00},
{3, 0x20, 0x60, 0xa0, 0xa0, 0x60, 0x00, 0x00, 0x00},
{3, 0x00, 0x60, 0xa0, 0xc0, 0x60, 0x00, 0x00, 0x00},
{2, 0x40, 0x80, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00},
{3, 0x00, 0x60, 0xa0, 0xa0, 0x60, 0x20, 0x40, 0x00},
{3, 0x80, 0xc0, 0xa0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{1, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00},
{2, 0x40, 0x00, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00},
{3, 0x80, 0xa0, 0xc0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{2, 0x80, 0x80, 0x80, 0x80, 0x40, 0x00, 0x00, 0x00},
{3, 0x00, 0xe0, 0xe0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0x00, 0xc0, 0xa0, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0x00, 0x60, 0xa0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0x00, 0xc0, 0xa0, 0xa0, 0xc0, 0x80, 0x80, 0x00},
{3, 0x00, 0x60, 0xa0, 0xa0, 0x60, 0x20, 0x20, 0x00},
{2, 0x00, 0x40, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00},
{3, 0x00, 0x60, 0x80, 0x20, 0xc0, 0x00, 0x00, 0x00},
{2, 0x80, 0xc0, 0x80, 0x80, 0x40, 0x00, 0x00, 0x00},
{3, 0x00, 0xa0, 0xa0, 0xa0, 0xc0, 0x00, 0x00, 0x00},
{3, 0x00, 0xa0, 0xa0, 0xa0, 0x40, 0x00, 0x00, 0x00},
{3, 0x00, 0xa0, 0xa0, 0xe0, 0xe0, 0x00, 0x00, 0x00},
{3, 0x00, 0xa0, 0x40, 0xa0, 0xa0, 0x00, 0x00, 0x00},
{3, 0x00, 0xa0, 0xa0, 0xa0, 0x60, 0x20, 0x40, 0x00},
{3, 0x00, 0xe0, 0x20, 0x80, 0xe0, 0x00, 0x00, 0x00},
{3, 0x60, 0x40, 0xc0, 0x40, 0x60, 0x00, 0x00, 0x00},
{1, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00},
{3, 0xc0, 0x40, 0x60, 0x40, 0xc0, 0x00, 0x00, 0x00},
{3, 0x00, 0x20, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00},
{0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
};
#else
const uint8_t _default_font[96][9] = {
{1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{1, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x00},
Expand Down Expand Up @@ -141,6 +241,7 @@ namespace picosystem {
{0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
};
#endif
#endif

// https://github.com/32blit/32blit-sdk/blob/master/assets/s4m_ur4i-dingbads.png
// A collection of handy icons and graphics created for us by @s4m_ur4i
Expand Down

0 comments on commit 615439a

Please sign in to comment.