Including a new font
Including a new font
I create a new font to use it with DMD2 but on compilation says " Arial15 was not declared in this scope " . I use #include <fonts/Arial15.h> at the begin as the others fonts but it doesn´t let me compilate it. Am I missing something ? The font is in the same directory that the others. Plase somebody explain me. Thanks
Re: Including a new font
Hi @plito
I've always used the alternative #include syntaxso perhaps try
I just checked now, and even in our newer projects where I use the quoted syntax and DMD2, our custom fonts contained within the older DMD library directory are found and used okay by the IDE. Reading the C++ reference here I can't think of any satisfactory reason why one way would work over the other, just that the quoted syntax is the way I've always followed.
If that doesn't fix it, as I suspect, can you include your custom font file here to make sure it's not something fractured in there that's stopping it?
Geoff
I've always used the alternative #include syntax
Code: Select all
#include "Arial_black_16.h"
Code: Select all
#include "fonts/Arial15.h"
If that doesn't fix it, as I suspect, can you include your custom font file here to make sure it's not something fractured in there that's stopping it?
Geoff
Re: Including a new font
Thank you Geoff. I´ll try it and then I´ll tell you.
Re: Including a new font
Geoff. It doesn´t work putting "" . Now the compilation allow the header #include "fonts/Arial15.h" but give error when I put dmd.selectFont(Arial15) into the setup() , says " Arial15 was not declared in this scope " . I don´t understand why. Sorry for my english. Thanks
Re: Including a new font
Please upload your font file and I'll give it a try
Re: Including a new font
Thank you Geoff
Re: Including a new font
Did you see that all the font references in this file are called that still? When you #include this font, the file name is not relevant to the compiler but the content is...these lines will mean you're defining a font called Arial_Black_16 regardless what your filename is therefore.
Change those, and you should be good to go
Geoff
Code: Select all
#ifndef ARIAL_BLACK_15_H
#define ARIAL_BLACK_16_H
#define ARIAL_BLACK_16_WIDTH 10
#define ARIAL_BLACK_16_HEIGHT 16
static const uint8_t Arial_Black_16[] PROGMEM = {

Geoff
Re: Including a new font
Thank you Geoff. I´d changed the character bytes but I didn´t know what you explain me. Thank you again.