Fonts

From Arduboy Wiki
Revision as of 02:18, 25 August 2024 by Filmote (talk | contribs) (Created page with "=== Font3x5 === Font3x5 is a simple library that provides a 3 x 5 pixel font which has the upper- and lower-case alphabet, numbers and the exclamation mark and the period. You can easily add extra characters if you like. There is a #define that allows you to remove the lower case letters. Doing so strips out 108 bytes. A sample program is shown below: <pre> #include <Arduboy2.h> #include "src/fonts/Font3x5.h" Arduboy2Base arduboy; Font3x5 font3x5 = Font3x5(); void...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Font3x5

Font3x5 is a simple library that provides a 3 x 5 pixel font which has the upper- and lower-case alphabet, numbers and the exclamation mark and the period. You can easily add extra characters if you like.

There is a #define that allows you to remove the lower case letters. Doing so strips out 108 bytes.

A sample program is shown below:

#include <Arduboy2.h>
#include "src/fonts/Font3x5.h"

Arduboy2Base arduboy;
Font3x5 font3x5 = Font3x5();

void setup() {

   arduboy.boot();

}

void loop() {

    if (!(arduboy.nextFrame())) return;

    arduboy.clear();
    font3x5.setCursor(12, 12);
    font3x5.print(F("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
    font3x5.print(F("\nabcdefghijklmnopqrstuvwxyz"));
    font3x5.print(F("\n0123456789"));
    font3x5.print(F("\n!."));

    arduboy.display();

}