lexus2k / ssd1306

Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
MIT License
678 stars 127 forks source link

Custom Font definition #46

Closed sorriso93 closed 6 years ago

sorriso93 commented 6 years ago

Hello I would try to use a custom font using the font generator by squid, http://oleddisplay.squix.ch/#/home. What kind of library version should I choose to generate the header file? (> 3.0, adafruit, < 3.0)

many thanks

lexus2k commented 6 years ago

Hello I checked that link. That is really good font generator. Unfortunately it generates fonts with dynamic chars width, and ssd1306 can use only fixed width fonts. So, I can learn the font format over the link, and get back to you with library update. But it will take some time.

Let me know, what you think.

sorriso93 commented 6 years ago

Well if you think can be useful to others to have dynamic chars width for me is ok. As alternative do you know a similar font generator for fixes width fonts? Many thanks

lexus2k commented 6 years ago

Please check GLCD Font creator tool: https://github.com/lexus2k/ssd1306/wiki/How-to-create-new-font-for-the-library

lexus2k commented 6 years ago

Hello, I added generator, written in python, for new font format. It is possible now to generate fonts from TTF files. Demo draw_unicode_text demonstrates how new fonts work. PS. Unfortunately, squix library uses completely different format, than ssd1306 library, for storing bitmaps.

sorriso93 commented 6 years ago

Many thanks, as soon as I have time I'll look into it.

lexus2k commented 6 years ago

Hello,

example of font generating from ttf file:

python ./fontgenerator.py --ttf FreeMono.ttf -s 7 -d -f new > my_font.h

then #include "my_font.h" to your application and set the font with:

ssd1306_setFreeFont(free_FreeMono8x8);

Here you can find instructions in details: https://github.com/lexus2k/ssd1306/wiki/How-to-create-new-font-for-the-library

sorriso93 commented 6 years ago

Should I change the fontgenerator.py to see the freetype module? below a log of the commands, or in alternative change/add relative path somewhere in my osx configuration (must admit I don't know where...) thks

MaxMacBookAir:tools yoghibear$ python fontgenerator.py --ttf "Fonts/Arial Black.ttf" -f old > ssd1306font.h Traceback (most recent call last): File "fontgenerator.py", line 137, in from modules import ttfsource File "/Users/yoghibear/Library/Mobile Documents/com~apple~CloudDocs/Privato/progetti casa/progr esp2866/03_library_examples/01_displays/04_examples_ssd1306_1331_1351_il9163/tools/modules/ttfsource.py", line 33, in import freetype ImportError: No module named freetype MaxMacBookAir:tools yoghibear$ freetype-config --cflags -I/usr/local/opt/freetype/include/freetype2 MaxMacBookAir:tools yoghibear$

lexus2k commented 6 years ago

Did you install freetype python module? You need to use python 2.7 and install freetype python module via pip command:

sudo pip install freetype-py

I don't have osx, so you need to search over Internet, how to install python modules on your system

sorriso93 commented 6 years ago

.... I thought I installed it... you are right, now I generated the .h file, this night will try the custom font... many thks I let you know when my project will be finished.

lexus2k commented 6 years ago

ok, I will be waiting for your feedback.

sorriso93 commented 6 years ago

Hello, below the code. I use ST1351 on SPI (maybe this can be the problem)... Anyway, no error on compiling and execution but the screen remains totally black... Thanks

include "ssd1306.h"

extern const uint8_t Raleway_Black13x11[] PROGMEM; const uint8_t Raleway_Black13x11[] PROGMEM = {

ifdef CONFIG_SSD1306_UNICODE_ENABLE

// type|width|height|first char 0x01, 0x0D, 0x0B, 0x20, // unicode(2B)|count 0x20, 0x00, 0x60, // unicode record

else

// type|width|height|first char 0x00, 0x0D, 0x0B, 0x20,

endif

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char ' ' (0x0020/32)
0xBE, 0xBE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '!' (0x0021/33)
0x0E, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '"' (0x0022/34)
0x00, 0x60, 0x78, 0xF8, 0x7E, 0xFA, 0x7E, 0x7E, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '#' (0x0023/35)
0x00, 0x00, 0xDC, 0xBE, 0xFF, 0xF6, 0xEC, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '$' (0x0024/36)
0x00, 0x04, 0x0E, 0x8A, 0x4E, 0x20, 0xD8, 0xEC, 0xE2, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // char '%' (0x0025/37)
0x00, 0x40, 0xFE, 0xBE, 0xBE, 0xEE, 0xE0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // char '&' (0x0026/38)
0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char ''' (0x0027/39)
0x00, 0x70, 0xFE, 0x8E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '(' (0x0028/40)
0x00, 0x02, 0xDE, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char ')' (0x0029/41)
0x00, 0x04, 0x0E, 0x0E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '*' (0x002A/42)
0x00, 0x30, 0x78, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '+' (0x002B/43)
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char ',' (0x002C/44)
0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '-' (0x002D/45)
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '.' (0x002E/46)
0x00, 0x00, 0x80, 0xC0, 0xF0, 0x38, 0x1C, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '/' (0x002F/47)
0x00, 0x20, 0xF8, 0xFC, 0x8C, 0xFC, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '0' (0x0030/48)
0x00, 0x30, 0xB8, 0xFC, 0xFC, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '1' (0x0031/49)
0x00, 0x08, 0xD8, 0xCC, 0xEC, 0xFC, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '2' (0x0032/50)
0x00, 0x10, 0x38, 0xD8, 0xD8, 0xF8, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x06, 0x06, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '3' (0x0033/51)
0x00, 0x80, 0xE0, 0xF0, 0xF8, 0xFC, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '4' (0x0034/52)
0x00, 0x80, 0xF8, 0xF8, 0xD8, 0xD8, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x07, 0x06, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '5' (0x0035/53)
0x00, 0x30, 0xFC, 0xF6, 0x9E, 0xFE, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '6' (0x0036/54)
0x00, 0x0C, 0x0C, 0xCC, 0xFC, 0x3C, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '7' (0x0037/55)
0x00, 0x40, 0xFC, 0xFE, 0xB6, 0xFE, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '8' (0x0038/56)
0x00, 0x60, 0xF8, 0xD8, 0xD8, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x06, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '9' (0x0039/57)
0x98, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char ':' (0x003A/58)
0x98, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char ';' (0x003B/59)
0x00, 0x40, 0x60, 0xF0, 0xF0, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '<' (0x003C/60)
0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '=' (0x003D/61)
0xB8, 0xF0, 0xE0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '>' (0x003E/62)
0x00, 0x04, 0xA6, 0xB6, 0x1E, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '?' (0x003F/63)
0x00, 0xE0, 0x18, 0x88, 0xF4, 0x54, 0x74, 0xE4, 0x08, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x05, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, // char '@' (0x0040/64)
0x00, 0x80, 0xE0, 0xFC, 0x4E, 0x7E, 0xF8, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'A' (0x0041/65)
0xFE, 0xFE, 0xB6, 0xB6, 0xFE, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'B' (0x0042/66)
0x00, 0x30, 0xFC, 0xCE, 0x86, 0x86, 0xCE, 0x84, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'C' (0x0043/67)
0xFE, 0xFE, 0x86, 0x86, 0xFE, 0xFC, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'D' (0x0044/68)
0xFE, 0xFE, 0xB6, 0xB6, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'E' (0x0045/69)
0xFE, 0xFE, 0x36, 0x36, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'F' (0x0046/70)
0x00, 0x30, 0xFC, 0xCE, 0x86, 0x86, 0xE6, 0xEC, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // char 'G' (0x0047/71)
0xFE, 0xFE, 0x30, 0x30, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'H' (0x0048/72)
0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'I' (0x0049/73)
0x00, 0x80, 0x80, 0x80, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'J' (0x004A/74)
0xFE, 0xFE, 0x38, 0xFC, 0xCE, 0x82, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'K' (0x004B/75)
0xFE, 0xFE, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'L' (0x004C/76)
0xFE, 0xFE, 0x3C, 0xF0, 0x78, 0x1E, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'M' (0x004D/77)
0xFE, 0xFE, 0x38, 0x70, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'N' (0x004E/78)
0x00, 0x30, 0xFC, 0xCE, 0x86, 0x86, 0x86, 0xFC, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'O' (0x004F/79)
0xFE, 0xFE, 0x66, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'P' (0x0050/80)
0x00, 0x30, 0xFC, 0xCE, 0xA6, 0xC6, 0xC6, 0xFC, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // char 'Q' (0x0051/81)
0xFE, 0xFE, 0x66, 0xE6, 0xFE, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'R' (0x0052/82)
0x00, 0x88, 0xFC, 0xBE, 0xB6, 0xF6, 0xEE, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'S' (0x0053/83)
0x00, 0x06, 0x06, 0xFE, 0xFE, 0xFE, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'T' (0x0054/84)
0xFE, 0xFE, 0x80, 0x80, 0xFE, 0xFE, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'U' (0x0055/85)
0x00, 0x06, 0x1E, 0xFC, 0xC0, 0xF8, 0x3E, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'V' (0x0056/86)
0x00, 0x06, 0x1E, 0xFC, 0xE2, 0xFE, 0x7C, 0xFE, 0xCE, 0xF0, 0x7E, 0x0E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, // char 'W' (0x0057/87)
0x00, 0x02, 0x8E, 0xFC, 0x78, 0xFC, 0xCE, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'X' (0x0058/88)
0x00, 0x02, 0x0E, 0x3C, 0xF0, 0xFC, 0x1E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'Y' (0x0059/89)
0x00, 0x86, 0xC6, 0xE6, 0xFE, 0x9E, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'Z' (0x005A/90)
0xFE, 0xFE, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '[' (0x005B/91)
0x00, 0x02, 0x06, 0x1E, 0x38, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char '\' (0x005C/92)
0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char ']' (0x005D/93)
0x00, 0x10, 0x18, 0x1E, 0x06, 0x1E, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '^' (0x005E/94)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '_' (0x005F/95)
0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '`' (0x0060/96)
0x00, 0xC8, 0xF8, 0xB8, 0xB8, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'a' (0x0061/97)
0xFE, 0xFE, 0x98, 0x98, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'b' (0x0062/98)
0x00, 0x60, 0xF0, 0x98, 0x98, 0x98, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'c' (0x0063/99)
0x00, 0x60, 0xF8, 0x98, 0x98, 0xBE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'd' (0x0064/100)
0x00, 0x60, 0xF0, 0xF8, 0xF8, 0xF8, 0xF0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'e' (0x0065/101)
0x00, 0x30, 0xFC, 0xFE, 0x36, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'f' (0x0066/102)
0x00, 0x60, 0xF8, 0x98, 0x98, 0xF0, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'g' (0x0067/103)
0xFE, 0xFE, 0x18, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'h' (0x0068/104)
0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'i' (0x0069/105)
0x00, 0x00, 0x00, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'j' (0x006A/106)
0xFE, 0xFE, 0xF0, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'k' (0x006B/107)
0x00, 0xFE, 0xFE, 0xFE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'l' (0x006C/108)
0xF8, 0xF0, 0x18, 0xF8, 0xF8, 0x10, 0x18, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // char 'm' (0x006D/109)
0xF8, 0xF0, 0x18, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'n' (0x006E/110)
0x00, 0x60, 0xF0, 0x98, 0x98, 0xF8, 0xF0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'o' (0x006F/111)
0xF8, 0xF0, 0x98, 0x98, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'p' (0x0070/112)
0x00, 0x60, 0xF8, 0x98, 0x98, 0xF0, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x03, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'q' (0x0071/113)
0xF8, 0xF0, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'r' (0x0072/114)
0x00, 0xB0, 0xB8, 0xB8, 0xD8, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 's' (0x0073/115)
0x00, 0x18, 0xFE, 0xFE, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 't' (0x0074/116)
0x00, 0x78, 0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'u' (0x0075/117)
0x00, 0x08, 0xF8, 0xF0, 0xC0, 0xF8, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'v' (0x0076/118)
0x00, 0x18, 0x78, 0xE0, 0xD8, 0x70, 0xF8, 0xC8, 0xF8, 0x38, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'w' (0x0077/119)
0x00, 0x08, 0x98, 0xF0, 0xF0, 0xB8, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'x' (0x0078/120)
0x00, 0x08, 0x78, 0xF0, 0xC0, 0xF8, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'y' (0x0079/121)
0x00, 0x98, 0xD8, 0xF8, 0xB8, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char 'z' (0x007A/122)
0x00, 0x30, 0xFE, 0xFE, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '{' (0x007B/123)
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '|' (0x007C/124)
0xFE, 0xFE, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '}' (0x007D/125)
0x30, 0x10, 0x20, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '~' (0x007E/126)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // char '' (0x007F/127)

ifdef CONFIG_SSD1306_UNICODE_ENABLE

0x00, 0x00, 0x00, // end of unicode tables

endif

};

void setup() { / Replace the line below with ssd1306_128x32_i2c_init() if you need to use 128x32 display / //ssd1306_128x64_i2c_init(); ssd1351_128x128_spi_init(3, 4, 5); ssd1306_fillScreen(0x00); //ssd1306_setFreeFont(free_calibri11x12); ssd1306_setFreeFont(Raleway_Black13x11); //ssd1306_setSecondaryFont(free_calibri11x12_cyrillic); ssd1306_printFixed(0, 8, u8"This is Русский", STYLE_NORMAL);

//ssd1306_setSecondaryFont(free_calibri11x12_latin);
ssd1306_printFixed(0, 24, u8"This is Deutsch Länder", STYLE_NORMAL);

}

void loop() { }

sorriso93 commented 6 years ago

I just need a bigger font, not important which one...

lexus2k commented 6 years ago

I found several issues:

  1. The bug in the library, when secondary font is not set. I fixed it with latest commit.
  2. The issue with font generator for old format font. It is fixed also.
  3. There is bug in the sketch, you provided, since you generated old format font, but try to set the font via ssd1306_setFreeFont() (which can be used only for new fonts).

Please, pull latest fixes, regenerate the font (either old or new format, the command for new font format is in this thread) and use correct function to set the font. Let me know if calibri is good for you, I can generate another size for you.

lexus2k commented 6 years ago

Can you confirm, that the code works for you now?

sorriso93 commented 6 years ago

Hi, right now I'm working with another tft display and I paused the oled ST1351 tests. As soon as I have spare time I'll let you know. Many thanks

lexus2k commented 6 years ago

I closed the ticket. But feel free to reopen it, if you stil have any issues.