0 votes
by (170 points)
Hello!
I get a lot of fun working with the ESP8266 OLED Display library!
But I had a small problem: http://oleddisplay.squix.ch/ creates a font with only Latin characters. How / where can I create a font with Cyrillic symbols?

1 Answer

+1 vote
by (2.9k points)
selected by
 
Best answer

Hi,

You can check my stuff here

Right upper menu - other tools, I have modified this Squix' generator to a local standalone font converter JAR from your system fonts including Cyrillic adjustments. See other-tools.zip -> win32-and-lin-java -> run_jar_V3.bat. Requires JRE.

For example 'java -jar "FontConverterV3.jar" "Arial" 16 bc'  generates Bold Latin+Cyrillic

After that, you can load the result to the editor at the link and play with bitmap of each character if you want.

by (170 points)
TY a lot! You make my day! But text doesn't print on screen (its blank) when I try print Cyrilic string
by (170 points)
utf8ascii returns 0 when see Cyrilic symbol.
by (2.9k points)
edited by
OK good job you have done
by (170 points)
edited by
Sloved this problem by adding to utf8ascii code into OLEDDisplay.cpp:

switch (last){
    case 0xD0: {if (ascii == 0x81) { ascii = 0xA8; return  (ascii); break; } //Ё
                if (ascii >= 0x90 && ascii <= 0xBF) ascii = ascii + 0x30; return  (ascii);
                break;}
    case 0xD1: {
                if (ascii == 0x91) { ascii = 0xB8; return  (ascii); break; } //ё
                if (ascii >= 0x80 && ascii <= 0x8F) ascii = ascii + 0x70; return  (ascii);
                break;}
}  

OFFTOP:
1.  i don't why, but "FontConverterV3.jar" crashes under Ubuntu =(
2.  I should manually edit font after converting for adding Ё (ASCII - 168) ё(ASCII - 184)
by (2.9k points)
Yes, exactly, I forgot I was using for test something from http://zelectro.cc/lcd_russian_symbols
No idea why it crashes on Ubuntu, the jar was build by NetBeans on Win32 JDK
by (170 points)
Can I get sources for this? i just try to build it under Ubuntu.
Cuz its annoying to switch system
by (2.9k points)
I just used this idea: https://github.com/squix78/minigrafx/issues/9#issuecomment-336300145
I passed through main[] command paramaters
You can make it easily your way, including Ё (ASCII - 168) ё(ASCII - 184) patch :)
by (170 points)
Yeah :) But i have no idea how code in java :)
by (2.9k points)
Me too :) that's why my java files were not very good to be shared.  Okay i will clean a bit and share what I did. I need some time. Also, another nice  tool update is coming soon.
by (2.9k points)
edited by
Hi again bangka. If you re-download again my zip file (you may need to clear browser cache to get updated zip), I added the java sources there.
I also modified codes to get Ё and ё as you said, and cleaned to ' ' all unused symbols to save memory.  See my fork of esp8266-oled-ssd1306 repository - I added Cyrillic stuff there, too and similar to your mod in OLEDDisplay.cpp. (but not tested yet).

Enjoy
by (170 points)
edited by
Ty a lot! All works fine ) Already tested. I also modify FontConverterV3.java by myself, but your code looks much pretty than my =)

OFFTOP:
I found why is FontConverterV3.jar crashes on Ubuntu. It was openjdk-9-jre. I remove thisone and replace by openjdk-8-jre.
by (2.9k points)
Good! If you make alternative clean Cyrillic 10, 16 and 24 sized arrays (other than Arial) to be used as  OLEDDisplayFonts.h, please share.

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...