markruys / arduino-Max72xxPanel

Arduino interface for Adafruit-GFX to control a set of 8x8 LEDs with a MAX7219 or MAX7221
Other
165 stars 85 forks source link

How to Change Fonts? #5

Open jay6621 opened 7 years ago

jay6621 commented 7 years ago

Thank you so much for this lovely library. What if I want to use other font ? I included font file from font folder, then I have tried calling matrix.setfont(address of font), but it didn't displayed correctly(no characters at all), when passed NULL value in setfont then it works perfectly. Please Reply.

jay6621 commented 7 years ago

Hello Guys.. Please Reply.. I need Help..

avk013 commented 7 years ago

Hard core - Example user font http://tronixstuff.com/2013/10/11/tutorial-arduino-max7219-led-display-driver-ic/ but I reccomend https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts

jay6621 commented 7 years ago

Thanks avk013 , First Link you suggested is working fine but it is using LedControl library, Second which you recommended,( I too preferring that ) is not working or I am doing wrong. What I did is set font using setFont(); function but it did not displayed correctly.. I would be happy to work on this code. Please Suggest some way to work on..

AHorneffer commented 6 years ago

@jay6621 For my the setFont() works. But the reference "baseline" for the default font and the font libraries seems to be different: the reference for the default font seems to be the top of the font, and for the others it seems to be the bottom line.

joveaaron commented 2 years ago

I am having the same issue. I have created my own font too, but I am having trouble trying to figure out the syntax of SetFont();. I have looked at the documentation but I can't seem to figure out what do some things mean. The built-in MD_Parola example is very confusing because of the way it's coded. If someone has figured out an easy solution to this, or has this little piece of code in it's project somewhere that is giving us so many headaches, please, share it. Regards, Aaron.

bobosch commented 1 year ago

Use https://pjrp.github.io/MDParolaFontEditor

#include <MD_MAX72xx.h>
#include <MD_Parola.h>

MD_MAX72XX::fontType_t newFont[] PROGMEM = 
{
...
};

(don't forget the ";" at the end)

void setup() {
  P.begin();
  P.setFont(newFont);
}