Working large (16px high) fonts?

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
Warwick
Posts: 4
Joined: Tue Dec 01, 2015 2:09 pm

Working large (16px high) fonts?

Post by Warwick » Tue Dec 01, 2015 2:26 pm

Hi, Trying to implement a simple two digit scoreboard on a single 32x16 DMD, using the largest possible characters. I have found two fonts 'mybigfont' and 'fixednums8x16' but neither work using the DMD library under Arduino 1.6.6 .. which Googling has something to do with a clash between updated compiler components and obsolete LCD libraries.

Error is "error: variable 'MyBigFont' must be const in order to be put into read-only section by means of '__attribute__((progmem))'"

Anyone know how to clear this issue, or have access to a full 16 pix high font? I only need 0-9 and a decimal/ mid point. Thanks in advance

User avatar
stryker
Posts: 268
Joined: Sat Jan 14, 2012 2:44 pm

Re: Working large (16px high) fonts?

Post by stryker » Tue Dec 01, 2015 9:22 pm

Hi Warwick

I use MyBigFont in a couple of our projects but realise just now I'm using IDE 1.6.5. If you don't have a win with this beforehand I'll update this weekend and see what I can see. Do the other fonts still work okay?

Geoff

Warwick
Posts: 4
Joined: Tue Dec 01, 2015 2:09 pm

Re: Working large (16px high) fonts?

Post by Warwick » Tue Dec 01, 2015 11:41 pm

The ones included with the DMD library work fine. Possibly I'm doing something else wrong, but I have MyBigFont in the same directory as the others, and include it in the main project in the same way?

User avatar
stryker
Posts: 268
Joined: Sat Jan 14, 2012 2:44 pm

Re: Working large (16px high) fonts?

Post by stryker » Wed Dec 02, 2015 12:13 am

Mine looks like this:

Code: Select all

#include <MyBigFont.h>                                                  // 16x10 big font
#include "Arial_black_16.h"
#include "SystemFont5x7.h"
Then later,

Code: Select all

  dmd.clearScreen(true);
  dmd.selectFont(MyBigFont);                                            // big thick type
or

Code: Select all

dmd.selectFont(Arial_Black_16);

Code: Select all

dmd.selectFont(System5x7);
I'm pretty certain the use of <> versus quotes in the include directive makes no difference and is probably just down to a late night of coding on autopilot, as these headers are in the DMD library directory just as you've said yours are. The only thing you might be getting wrong is the capitalisation of the font name based on your above text?

I'm currently tethered to my cellphone so won't be back to broadband (civilisation!) until the weekend or I'd give this a crack tonight.

HTH
Geoff

Warwick
Posts: 4
Joined: Tue Dec 01, 2015 2:09 pm

Re: Working large (16px high) fonts?

Post by Warwick » Wed Dec 02, 2015 9:43 am

I'm not even getting that far! My program runs fine with dmd.selectFont to one of the existing fonts, but fails with the new MyBigFont. Even just adding the #include for MyBigFont throws the error, without me even then subsequently referencing with a select. The error in full is:

Code: Select all

C:\Users\restofpath\libraries\DMD-master/MyBigFont.h:56:28: error: variable 'MyBigFont' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 static uint8_t MyBigFont[] PROGMEM = { // the name here 'MyBigFont' must be used to refer to this font

                            ^

exit status 1
Error compiling.
Am I perhaps using an 'old' MyBigFont - where is the definitive up to date one, that is known to work under current IDE? (if indeed there is one). Thanks again.

User avatar
stryker
Posts: 268
Joined: Sat Jan 14, 2012 2:44 pm

Re: Working large (16px high) fonts?

Post by stryker » Wed Dec 02, 2015 12:14 pm

The declaration it appears to be pointing to is the same format in the working fonts for mine...

Code: Select all

const static uint8_t Arial_Black_16[] PROGMEM = {

Code: Select all

const static uint8_t System5x7[] PROGMEM = {
looks just like

Code: Select all

const static uint8_t MyBigFont[] PROGMEM = { 
However, notice that mine has const at the front like the others, yet yours didn't?

I think we might be onto something. Add that in and you should be good. I don't know how yours would be different?
Geoff

Warwick
Posts: 4
Joined: Tue Dec 01, 2015 2:09 pm

Re: Working large (16px high) fonts?

Post by Warwick » Wed Dec 02, 2015 3:51 pm

Perfect - working fine with that change. No idea why my file was like that. Haden't edited it at all - wouldn't know what I was editing at that level!!

Thanks so much!

User avatar
stryker
Posts: 268
Joined: Sat Jan 14, 2012 2:44 pm

Re: Working large (16px high) fonts?

Post by stryker » Thu Dec 03, 2015 1:31 am

Glad that it all worked out so easy Warwick.

Post Reply