AaronLiddiment / LEDText

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

proper display of lower / upper case when 8 lines availables #9

Open vincenet opened 7 years ago

vincenet commented 7 years ago

With 8 lines availables, I need to display well lower and upper case letters. Find my suggestion here, from the font Matrise, some letters inspired from adafruit gfx examples. 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 ) 0x00, 0xa8, 0x70, 0x20, 0x70, 0xa8, 0x00, 0x00, // Code for char * 0x00, 0x20, 0x20, 0xf8, 0x20, 0x20, 0x00, 0x00, // Code for char + 0x00, 0x00, 0x00, 0x60, 0x60, 0x20, 0x40, 0x00, // Code for char , 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, // Code for char - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, // Code for char . 0x10, 0x10, 0x20, 0x20, 0x20, 0x40, 0x40, 0x00, // Code for char / 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char 0 0x20, 0x60, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, // Code for char 1 0x70, 0x88, 0x08, 0x10, 0x20, 0x40, 0xf8, 0x00, // Code for char 2 0xf8, 0x08, 0x10, 0x30, 0x08, 0x88, 0x70, 0x00, // Code for char 3 0x10, 0x30, 0x50, 0x90, 0xf8, 0x10, 0x10, 0x00, // Code for char 4 0xf8, 0x80, 0xf0, 0x08, 0x08, 0x88, 0x70, 0x00, // Code for char 5 0x30, 0x40, 0x80, 0xf0, 0x88, 0x88, 0x70, 0x00, // Code for char 6 0xf8, 0x08, 0x10, 0x20, 0x20, 0x20, 0x20, 0x00, // Code for char 7 0x70, 0x88, 0x88, 0x70, 0x88, 0x88, 0x70, 0x00, // Code for char 8 0x70, 0x88, 0x88, 0x78, 0x08, 0x10, 0x60, 0x00, // Code for char 9 0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x00, // Code for char : 0x60, 0x60, 0x00, 0x60, 0x60, 0x20, 0x40, 0x00, // Code for char ; 0x10, 0x20, 0x40, 0x80, 0x40, 0x20, 0x10, 0x00, // Code for char < 0x00, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x00, 0x00, // Code for char = 0x80, 0x40, 0x20, 0x10, 0x20, 0x40, 0x80, 0x00, // Code for char > 0x70, 0x88, 0x08, 0x10, 0x20, 0x00, 0x20, 0x00, // Code for char ? 0x70, 0x88, 0xa8, 0xd8, 0xb0, 0x80, 0x70, 0x00, // Code for char @ 0x20, 0x50, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x00, // Code for char A 0xf0, 0x88, 0x88, 0xf0, 0x88, 0x88, 0xf0, 0x00, // Code for char B 0x70, 0x88, 0x80, 0x80, 0x80, 0x88, 0x70, 0x00, // Code for char C 0xe0, 0x90, 0x88, 0x88, 0x88, 0x90, 0xe0, 0x00, // Code for char D 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, 0xf8, 0x00, // Code for char E 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, 0x80, 0x00, // Code for char F 0x70, 0x88, 0x80, 0xb8, 0x88, 0x88, 0x70, 0x00, // Code for char G 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x00, // Code for char H 0x70, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, // Code for char I 0x38, 0x10, 0x10, 0x10, 0x10, 0x90, 0x60, 0x00, // Code for char J 0x88, 0x90, 0xa0, 0xc0, 0xa0, 0x90, 0x88, 0x00, // Code for char K 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf8, 0x00, // Code for char L 0x88, 0xd8, 0xa8, 0xa8, 0x88, 0x88, 0x88, 0x00, // Code for char M 0x88, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x88, 0x00, // Code for char N 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char O 0xf0, 0x88, 0x88, 0xf0, 0x80, 0x80, 0x80, 0x00, // Code for char P 0x70, 0x88, 0x88, 0x88, 0xa8, 0x90, 0x68, 0x00, // Code for char Q 0xf0, 0x88, 0x88, 0xf0, 0xa0, 0x90, 0x88, 0x00, // Code for char R 0x70, 0x88, 0x80, 0x70, 0x08, 0x88, 0x70, 0x00, // Code for char S 0xf8, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, // Code for char T 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char U 0x88, 0x88, 0x88, 0x88, 0x88, 0x50, 0x20, 0x00, // Code for char V 0x88, 0x88, 0x88, 0xa8, 0xa8, 0xa8, 0x50, 0x00, // Code for char W 0x88, 0x88, 0x50, 0x20, 0x50, 0x88, 0x88, 0x00, // Code for char X 0x88, 0x88, 0x50, 0x20, 0x20, 0x20, 0x20, 0x00, // Code for char Y 0xf8, 0x08, 0x10, 0x20, 0x40, 0x80, 0xf8, 0x00, // Code for char Z 0x70, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, 0x00, // Code for char [ 0x40, 0x40, 0x20, 0x20, 0x20, 0x10, 0x10, 0x00, // Code for char BackSlash 0x70, 0x10, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00, // Code for char ] 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, // Code for char _ 0x40, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0x00, 0x00, 0x60, 0x10, 0x70, 0x90, 0x78, 0x00, // Code for char a 0x80, 0x80, 0xb0, 0xc8, 0x88, 0x88, 0xf0, 0x00, // Code for char b 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, 0x70, 0x00, // Code for char c 0x08, 0x08, 0x68, 0x98, 0x88, 0x88, 0x78, 0x00, // Code for char d 0x00, 0x00, 0x70, 0x88, 0xf8, 0x80, 0x70, 0x00, // Code for char e 0x30, 0x40, 0xe0, 0x40, 0x40, 0x40, 0x40, 0x00, // Code for char f 0x00, 0x00, 0x70, 0x98, 0x98, 0x68, 0x08, 0x70, // Code for char g 0x80, 0x80, 0xb0, 0xc8, 0x88, 0x88, 0x88, 0x00, // Code for char h 0x20, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, // Code for char i 0x10, 0x00, 0x10, 0x10, 0x10, 0x90, 0x60, 0x00, // Code for char j 0x80, 0x80, 0x88, 0x90, 0xa0, 0xd0, 0x88, 0x00, // Code for char k 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x00, // Code for char l 0x00, 0x00, 0xd0, 0xa8, 0xa8, 0xa8, 0xa8, 0x00, // Code for char m 0x00, 0x00, 0xb0, 0xc8, 0x88, 0x88, 0x88, 0x00, // Code for char n 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char o 0x00, 0x00, 0xb0, 0xc8, 0xc8, 0xb0, 0x80, 0x80, // Code for char p 0x00, 0x00, 0x68, 0x98, 0x98, 0x68, 0x08, 0x08, // Code for char q 0x00, 0x00, 0xa0, 0xd0, 0x80, 0x80, 0x80, 0x00, // Code for char r 0x00, 0x00, 0x70, 0x80, 0x70, 0x08, 0xf0, 0x00, // Code for char s 0x40, 0x40, 0xf0, 0x40, 0x40, 0x40, 0x30, 0x00, // Code for char t 0x00, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, // Code for char u 0x00, 0x00, 0x88, 0x88, 0x88, 0x50, 0x20, 0x00, // Code for char v 0x00, 0x00, 0xa8, 0xa8, 0xa8, 0xa8, 0x50, 0x00, // Code for char w 0x00, 0x00, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, // Code for char x 0x00, 0x00, 0x88, 0x88, 0x98, 0x68, 0x08, 0x70, // Code for char y 0x00, 0x00, 0xf8, 0x10, 0x20, 0x40, 0xf8, 0x00, // Code for char z 0x10, 0x20, 0x20, 0x40, 0x20, 0x20, 0x10, 0x00, // Code for char { 0x20, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x00, // Code for char | 0x40, 0x20, 0x20, 0x10, 0x20, 0x20, 0x40, 0x00, // Code for char } 0x00, 0x00, 0x48, 0xb0, 0x00, 0x00, 0x00, 0x00, // Code for char ~ 0x70, 0x50, 0x50, 0x50, 0x50, 0x50, 0x70, 0x00 // Code for char 

keukenrol commented 4 years ago

The lowercase g and p are very big using the default font, this might help. This font is very useful!

keukenrol commented 4 years ago

problem

When using the EFFECT_SCROLL_UP in combination with the EFFECT_DELAY_FRAMES using captial letters, the text pauses 1 pixel row too high (bottom is 3rd pixel height). How can you lower the location where the upward movement is paused? EFFECT_DELAY_FRAMES "\x00\x64" @AaronLiddiment

EDIT: EFFECT_SCROLL_DOWN puts the text on the bottom LED's.

EDIT2: Fixed it with this font, in the LEDText.cpp file, go to lines 535 - 538 and replace with this:

    if ((opt & SCROLL_MASK) == SCROLL_DOWN)
      y = MinY = MaxY; // + 1 removed as font fix | 28/02/2020
    else if ((opt & SCROLL_MASK) == SCROLL_UP)
      y = MaxY = MinY; // - 1 removed as font fix | 28/02/2020

PS: I have also made the library.properties file for the LEDText, LEDMatrix and LEDSprites library, so that you can add the library in ArduinoDroid as well. Where can I share these files?