AaronLiddiment / LEDText

FastLED Flexible Text Message Class requires LEDMatrix Class
89 stars 32 forks source link

Change of Font Size #18

Open nmiloni opened 4 years ago

nmiloni commented 4 years ago

I am trying to adapt the existing font examples provided by Aaron Liddiment so as to have a 7 pixel wide and 8 pixel high font. Have read

Aaron Liddiment's instructions about the Font Header File Layout https://github.com/AaronLiddiment/LEDText/wiki/5.Font-Header-File-Layout

but somehow I don't get it how to solve this. I am an artist, so maybe that's why...

Coming from the FontRobotron example https://github.com/AaronLiddiment/LEDText/blob/master/FontRobotron.h

I thought I could basically

change the

const uint8_t RobotronFontData[] = { 7, // Font Width 7, // Font Height 32, // Font First Character 96, // Font Last Character

                B8(00000000),   // Char  
                B8(00000000),
                B8(00000000),
                B8(00000000),
                B8(00000000),
                B8(00000000),
                B8(00000000),

to

const uint8_t RobotronFontData[] = { 7, // Font Width 8, // Font Height 32, // Font First Character 96, // Font Last Character

                B8(00000000),   // Char  
                B8(00000000),
                B8(00000000),
                B8(00000000),
                B8(00000000),
                B8(00000000),
                B8(00000000),
                                      **B8(00000000),**

and so on for all other chars

But it doesn't seem that simple. Not sure what I am not getting. Has it something to do with the values 32 and 96 (Font First Character and Last Character)? For what do they stand for? Don't get how one gets to 32 and 96? What kind of calculation is underlying these figures?

Sorry, if too basic, but really don't get this. Any help is much appreciated!

Best, Nino

AaronLiddiment commented 4 years ago

The 32 and 96 refer to the number of characters included in the font. So this font has 96-32+1 or 65 characters. To change the font to an 8 pixel high font you are perfectly correct in just adding an extra line to each character as you did to the first character in the above example.

nmiloni commented 4 years ago

Hi Aaron

Thanks so much! Much appreciated. It worked and looks nice! Love your library!

Stay safe and healthy!

Best from Switzerland, Nino

On 28 Apr 2020, at 19:17, Aaron Liddiment notifications@github.com wrote:

The 32 and 96 refer to the number of characters included in the font. So this font has 96-32+1 or 65 characters. To change the font to an 8 pixel high font you are perfectly correct in just adding an extra line to each character as you did to the first character in the above example.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AaronLiddiment/LEDText/issues/18#issuecomment-620741930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO6DZPRHMKEW4Q4VTNBCVFLRO4FR3ANCNFSM4MS6IHIA.

AWiseAd commented 3 years ago

Opening an old issue. I am trying a similar thing to have the font size increase to 8 dots high. While using a 8 high matrix I am not able to have the bottom row empty. I.e. no change when I have 7 or 8 height. I have changed the Font height to 8 and added an extra row for each character (see below). Any idea what could happen?

const uint8_t MatriseFontData[] = { 5, // Font Width 8, // Font Height 32, // Font First Character 127,// Font Last Character 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x20, 0x00, // Code for char ! 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char " 0x50, 0x50, 0xf8, 0x50, 0xf8, 0x50, 0x0A, 0x00, // Code for char # 0x20, 0x78, 0x80, 0x70, 0x08, 0xf0, 0x20, 0x00, // Code for char $ 0xc8, 0xc8, 0x10, 0x20, 0x40, 0x98, 0x98, 0x00, // Code for char % 0x60, 0x90, 0x80, 0x78, 0x90, 0x90, 0x60, 0x00, // Code for char & 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ' 0x10, 0x20, 0x40, 0x40, 0x40, 0x20, 0x10, 0x00, // Code for char ( 0x40, 0x20, 0x10, 0x10, 0x10, 0x20, 0x40, 0x00, // Code for char )