Change font on Nokia 5110 LCD

Hello!

I am having trouble changing the font on a Nokia 5110 LCD using the Adafruit GFX and Adafruit PCD8544 libraries. (code shown below)

I have moved FreeMonoBold9pt7b.h into my sketch folder and included it, and then used display.setFont('FreeMonoBold9pt7b');

However, no text is displayed, but when I remove the setFont(), I do get text (but not in the font I want it in).

Any help would be greatly appreciated.

#include <ezButton.h>

#include <Adafruit_PCD8544.h>
#include <Adafruit_GFX.h>

#include "FreeMonoBold9pt7b.h"

Adafruit_PCD8544 display(6, 5, 4, 3, 2);

const byte player[] PROGMEM = {
  B00100000,
  B11111000,
  B10101000,
  B10001000,
  B11111000,
};

void splash_screen() {
  display.setFont('FreeMonoBold9pt7b');
  
  display.print("Tumblington");
  display.display();
}

void setup() {
  // put your setup code here, to run once:
  display.begin();
  display.setContrast(55);

  display.clearDisplay();

  splash_screen();
}

void loop() {
  // put your main code here, to run repeatedly:

}

Maybe try...
display.setFont(&FreeMonoBold9pt7b);

Thank you so much! This has fixed my problem!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.