Graphics::setFont

Description

void Graphics::setFont( const GFXfont* | const uint8_t* font )

Graphics::setFont allows you to set a different font. By default the 3x5 pixel font is used.

Parameters

  • const GFXfont* | const uint8_t* font: the font to use

Returns

none

Example

#include <Gamebuino-Meta.h>

extern const uint8_t font5x7[];
extern const uint8_t font3x5[];
extern const uint8_t font3x3[];

void setup() {
  gb.begin();
}

void loop() {
  gb.display.clear();
  gb.display.setCursor(0,0);
  gb.display.print( "Default font (3x5)\n" );
  gb.display.setFont( font5x7 );
  gb.display.print( "font 5x7\n" );
  gb.display.setFont( font3x5 );
  gb.display.print( "font 3x5\n" );
  gb.display.setFont( font3x3 );
  gb.display.print( "font 3x3\n" );
  while (!gb.update());
}