Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Cyrillic basic letters (ready-made font and code) #467

Closed
geo-mesh opened this issue Jan 4, 2024 · 18 comments
Closed
Labels
feature request New feature or request

Comments

@geo-mesh
Copy link

geo-mesh commented Jan 4, 2024

At the moment, AWTRIX does not support the Cyrillic font. I would like to see the Cyrillic alphabet in future firmware releases, for this I created a "UPPERCASE font" of 5px and a "lowercase font" of 4px. I also wrote the HEX-code for these fonts (only the addresses need to be edited). Please let me know if I can now count on Cyrillic support in future projects?

AWTRIX_Cyrillic_UPPERCASE_font AWTRIX_Cyrillic_lowercase_font
    // AWTRIX Cyrillic_basic  UTF-16
    
    0xA0, 0x00, 0xE0, 0x80, 0xC0, 0x80, 0xE0, /*[198]   0x401 Ё */
    0x60, 0x80, 0xC0, 0x80, 0x60,             /*[199]   0x404 Є */ 
    0x80, 0x80, 0x80, 0x80, 0x80,             /*[200]   0x406 І */ 
    0xA0, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, /*[201]   0x407 Ї */ 
    0xE0, 0xA0, 0xE0, 0xA0, 0xA0,             /*[202]   0x410 А */ 
    0xE0, 0x80, 0xE0, 0xA0, 0xC0,             /*[203]   0x411 Б */ 
    0xC0, 0xA0, 0xE0, 0xA0, 0xC0,             /*[204]   0x412 В */ 
    0xE0, 0x80, 0x80, 0x80, 0x80,             /*[205]   0x413 Г */ 
    0x60, 0x50, 0x50, 0x50, 0xE8,             /*[206]   0x414 Д */ 
    0xE0, 0x80, 0xC0, 0x80, 0xE0,             /*[207]   0x415 Е */  
    0xA8, 0xA8, 0x70, 0xA8, 0xA8,             /*[208]   0x416 Ж */ 
    0xC0, 0x20, 0x60, 0x20, 0xE0,             /*[209]   0x417 З */ 
    0xA0, 0xA0, 0xA0, 0xA0, 0xC0,             /*[210]   0x418 И */ 
    0x40, 0x00, 0xA0, 0xA0, 0xA0, 0xA0, 0xC0, /*[211]   0x419 Й */ 
    0xA0, 0xA0, 0xC0, 0xA0, 0xA0,             /*[212]   0x41A К */ 
    0x60, 0xA0, 0xA0, 0xA0, 0xA0,             /*[213]   0x41B Л */ 
    0x88, 0xD8, 0xA8, 0x88, 0x88,             /*[214]   0x41C М */ 
    0xA0, 0xA0, 0xE0, 0xA0, 0xA0,             /*[215]   0x41D Н */ 
    0xE0, 0xA0, 0xA0, 0xA0, 0xE0,             /*[216]   0x41E О */ 
    0xE0, 0xA0, 0xA0, 0xA0, 0xA0,             /*[217]   0x41F П */ 
    0xE0, 0xA0, 0xE0, 0x80, 0x80,             /*[218]   0x420 Р */ 
    0xE0, 0x80, 0x80, 0x80, 0xE0,             /*[219]   0x421 С */ 
    0xE0, 0x40, 0x40, 0x40, 0x40,             /*[220]   0x422 Т */ 
    0xA0, 0xA0, 0xE0, 0x40, 0x40,             /*[221]   0x423 У */ 
    0xF8, 0xA8, 0xF8, 0x20, 0x20,             /*[222]   0x424 Ф */ 
    0xA0, 0xA0, 0x40, 0xA0, 0xA0,             /*[223]   0x425 Х */ 
    0xA0, 0xA0, 0xA0, 0xA0, 0xD0,             /*[224]   0x426 Ц */ 
    0xA0, 0xA0, 0x60, 0x20, 0x20,             /*[225]   0x427 Ч */ 
    0xA8, 0xA8, 0xA8, 0xA8, 0xF8,             /*[226]   0x428 Ш */ 
    0xA8, 0xA8, 0xA8, 0xA8, 0xF4,             /*[227]   0x429 Щ */ 
    0xC0, 0x40, 0x70, 0x50, 0x70,             /*[228]   0x42A Ъ */ 
    0x88, 0x88, 0xE8, 0xA8, 0xE8,             /*[229]   0x42B Ы */ 
    0x80, 0x80, 0xE0, 0xA0, 0xE0,             /*[230]   0x42C Ь */ 
    0xC0, 0x20, 0x60, 0x20, 0xC0,             /*[231]   0x42D Э */ 
    0xB8, 0xA8, 0xE8, 0xA8, 0xB8,             /*[232]   0x42E Ю */ 
    0xE0, 0xA0, 0x60, 0xA0, 0xA0,             /*[233]   0x42F Я */
    0xC0, 0x60, 0xA0, 0xE0,             /*[234]   0x430 а */ 
    0x60, 0xC0, 0xA0, 0xE0,             /*[235]   0x431 б */ 
    0x40, 0xA0, 0xC0, 0xA0, 0xC0,       /*[236]   0x432 в */ 
    0xE0, 0xA0, 0x80, 0x80,             /*[237]   0x433 г */ 
    0x60, 0x50, 0x50, 0xE8,             /*[238]   0x434 д */ 
    0x60, 0xA0, 0xC0, 0x60,             /*[239]   0x435 е */ 
    0xA8, 0x70, 0xA8, 0xA8,             /*[240]   0x436 ж */ 
    0xC0, 0x20, 0x40, 0x20, 0xE0,        /*[241]   0x437 з */ 
    0xA0, 0xA0, 0xA0, 0xC0,             /*[242]   0x438 и */ 
    0x40, 0x00, 0xA0, 0xA0, 0xA0, 0xC0, /*[243]   0x439 й */ 
    0xA0, 0xC0, 0xA0, 0xA0,             /*[244]   0x43A к */ 
    0x60, 0xA0, 0xA0, 0xA0,             /*[245]   0x43B л */ 
    0x88, 0xD8, 0xA8, 0x88,             /*[246]   0x43C м */ 
    0xA0, 0xA0, 0xE0, 0xA0,             /*[247]   0x43D н */ 
    0x40, 0xA0, 0xA0, 0x40,             /*[248]   0x43E о */ 
    0xE0, 0xA0, 0xA0, 0xA0,             /*[249]   0x43F п */ 
    0xC0, 0xA0, 0xE0, 0x80,             /*[250]   0x440 р */ 
    0x60, 0x80, 0x80, 0x60,             /*[251]   0x441 с */ 
    0xE0, 0x40, 0x40, 0x40,             /*[252]   0x442 т */ 
    0xA0, 0xE0, 0x20, 0xC0,             /*[253]   0x443 у */ 
    0x78, 0xA8, 0xF0, 0x20,             /*[254]   0x444 ф */ 
    0xA0, 0x40, 0xA0, 0xA0,             /*[255]   0x445 х */ 
    0xA0, 0xA0, 0xA0, 0xD0,             /*[256]   0x446 ц */ 
    0xA0, 0xA0, 0x60, 0x20,             /*[257]   0x447 ч */ 
    0x88, 0xA8, 0xA8, 0x70,             /*[258]   0x448 ш */ 
    0x88, 0xA8, 0xA8, 0x74,             /*[259]   0x449 щ */ 
    0xC0, 0x60, 0x50, 0x60,             /*[260]   0x44A ъ */ 
    0x88, 0xC8, 0xA8, 0xC8,             /*[261]   0x44B ы */ 
    0x80, 0xC0, 0xA0, 0xC0,             /*[262]   0x44C ь */ 
    0xC0, 0x20, 0x60, 0x20, 0xC0,       /*[263]   0x44D э */ 
    0x98, 0xA8, 0xE8, 0xB0,             /*[264]   0x44E ю */ 
    0x60, 0xA0, 0x60, 0xA0,             /*[265]   0x44F я */
    0xA0, 0x00, 0x60, 0xA0, 0xC0, 0x60, /*[266]   0x451 ё */ 
    0x60, 0x80, 0xC0, 0x80, 0x60,       /*[267]   0x454 є */ 
    0x80, 0x00, 0x80, 0x80, 0x80, 0x80, /*[268]   0x456 і */ 
    0xA0, 0x00, 0x40, 0x40, 0x40, 0x40, /*[269]   0x457 ї */

    // Glyphs settings Cyrillic_basic UTF-16
    {890, 8, 7, 4, 0, -7}, /*[198]   0x401 Ё */ 
    {897, 8, 5, 4, 0, -5}, /*[199]   0x404 Є */
    {902, 8, 5, 2, 0, -5}, /*[200]   0x406 І */
    {907, 8, 7, 4, 0, -7}, /*[201]   0x407 Ї */  
    {914, 8, 5, 4, 0, -5}, /*[202]   0x410 А */ 
    {919, 8, 5, 4, 0, -5}, /*[203]   0x411 Б */
    {924, 8, 5, 4, 0, -5}, /*[204]   0x412 В */ 
    {929, 8, 5, 4, 0, -5}, /*[205]   0x413 Г */ 
    {934, 8, 5, 6, 0, -5}, /*[206]   0x414 Д */ 
    {939, 8, 5, 4, 0, -5}, /*[207]   0x415 Е */
    {944, 8, 5, 6, 0, -5}, /*[298]   0x416 Ж */
    {949, 8, 5, 4, 0, -5}, /*[209]   0x417 З */
    {954, 8, 5, 4, 0, -5}, /*[210]   0x418 И */
    {959, 8, 7, 4, 0, -7}, /*[211]   0x419 Й */ 
    {966, 8, 5, 4, 0, -5}, /*[212]   0x41A К */
    {971, 8, 5, 4, 0, -5}, /*[213]   0x41B Л */
    {976, 8, 5, 6, 0, -5}, /*[214]   0x41C М */
    {981, 8, 5, 4, 0, -5}, /*[215]   0x41D Н */
    {986, 8, 5, 4, 0, -5}, /*[216]   0x41E О */
    {991, 8, 5, 4, 0, -5}, /*[217]   0x41F П */
    {996, 8, 5, 4, 0, -5}, /*[218]   0x420 Р */
    {1001, 8, 5, 4, 0, -5}, /*[219]   0x421 С */
    {1006, 8, 5, 4, 0, -5}, /*[220]   0x422 Т */
    {1011, 8, 5, 4, 0, -5}, /*[221]   0x423 У */
    {1016, 8, 5, 6, 0, -5}, /*[222]   0x424 Ф */
    {1021, 8, 5, 4, 0, -5}, /*[223]   0x425 Х */
    {1026, 8, 5, 5, 0, -5}, /*[224]   0x426 Ц */
    {1031, 8, 5, 4, 0, -5}, /*[225]   0x427 Ч */
    {1036, 8, 5, 6, 0, -5}, /*[226]   0x428 Ш */ 
    {1041, 8, 5, 7, 0, -5}, /*[227]   0x429 Щ */
    {1046, 8, 5, 5, 0, -5}, /*[228]   0x42A Ъ */
    {1051, 8, 5, 6, 0, -5}, /*[229]   0x42B Ы */
    {1056, 8, 5, 4, 0, -5}, /*[230]   0x42C Ь */
    {1061, 8, 5, 4, 0, -5}, /*[231]   0x42D Э */
    {1066, 8, 5, 6, 0, -5}, /*[232]   0x42E Ю */
    {1071, 8, 5, 4, 0, -5}, /*[233]   0x42F Я */    
    {1076, 8, 4, 4, 0, -4}, /*[234]   0x430 а */
    {1080, 8, 4, 4, 0, -4}, /*[235]   0x431 б */ 
    {1084, 8, 5, 4, 0, -5}, /*[236]   0x432 в */ 
    {1091, 8, 4, 4, 0, -4}, /*[237]   0x433 г */ 
    {1095, 8, 4, 6, 0, -4}, /*[238]   0x434 д */
    {1099, 8, 4, 4, 0, -4}, /*[239]   0x435 е */
    {1103, 8, 4, 6, 0, -4}, /*[240]   0x436 ж */ 
    {1107, 8, 5, 4, 0, -5}, /*[241]   0x437 з */ 
    {1112, 8, 4, 4, 0, -4}, /*[242]   0x438 и */
    {1116, 8, 6, 4, 0, -6}, /*[243]   0x439 й */ 
    {1122, 8, 4, 4, 0, -4}, /*[244]   0x43A к */ 
    {1126, 8, 4, 4, 0, -4}, /*[245]   0x43B л */ 
    {1130, 8, 4, 6, 0, -4}, /*[246]   0x43C м */
    {1134, 8, 4, 4, 0, -4}, /*[247]   0x43D н */ 
    {1138, 8, 4, 4, 0, -4}, /*[248]   0x43E о */
    {1142, 8, 4, 4, 0, -4}, /*[249]   0x43F п */
    {1146, 8, 4, 4, 0, -4}, /*[250]   0x440 р */
    {1150, 8, 4, 4, 0, -4}, /*[251]   0x441 с */
    {1154, 8, 4, 4, 0, -4}, /*[252]   0x442 т */
    {1158, 8, 4, 4, 0, -4}, /*[253]   0x443 у */
    {1162, 8, 4, 6, 0, -4}, /*[254]   0x444 ф */
    {1166, 8, 4, 4, 0, -4}, /*[255]   0x445 х */ 
    {1170, 8, 4, 5, 0, -4}, /*[256]   0x446 ц */
    {1174, 8, 4, 4, 0, -4}, /*[257]   0x447 ч */
    {1178, 8, 4, 6, 0, -4}, /*[258]   0x448 ш */
    {1182, 8, 4, 7, 0, -4}, /*[259]   0x449 щ */
    {1186, 8, 4, 5, 0, -4}, /*[260]   0x44A ъ */
    {1190, 8, 4, 6, 0, -4}, /*[261]   0x44B ы */ 
    {1194, 8, 4, 4, 0, -4}, /*[262]   0x44C ь */
    {1198, 8, 5, 4, 0, -5}, /*[263]   0x44D э */
    {1203, 8, 4, 6, 0, -4}, /*[264]   0x44E ю */
    {1207, 8, 4, 4, 0, -4}, /*[265]   0x44F я */
    {1211, 8, 6, 4, 0, -6}, /*[266]   0x451 ё */ 
    {1217, 8, 5, 4, 0, -5}, /*[267]   0x454 э */
    {1222, 8, 6, 2, 0, -6}, /*[268]   0x456 і */
    {1228, 8, 6, 4, 0, -6}, /*[269]   0x457 ї */
@geo-mesh geo-mesh added the feature request New feature or request label Jan 4, 2024
@10der
Copy link
Contributor

10der commented Jan 6, 2024

@geo-mesh maybe I something miss here.
You provided ibm-866 encoding instead of UTF-16 encoding, what using right now in ./Awtrix Font.h

for example, "я" = 0x044F but not 0xEF

@geo-mesh
Copy link
Author

geo-mesh commented Jan 6, 2024

@geo-mesh maybe I something miss here. You provided ibm-866 encoding instead of UTF-16 encoding, what using right now in ./Awtrix Font.h

for example, "я" = 0x044F but not 0xEF

Thanks for the information. I'll redo the code to UTF-16.

@geo-mesh
Copy link
Author

geo-mesh commented Jan 6, 2024

@geo-mesh maybe I something miss here. You provided ibm-866 encoding instead of UTF-16 encoding, what using right now in ./Awtrix Font.h

for example, "я" = 0x044F but not 0xEF

I have already fixed this and added a new code with UTF-16. Thanks again.

@10der
Copy link
Contributor

10der commented Jan 6, 2024

@geo-mesh Sir, can I ask you a little deal. Can you reserve 3 x 2 chars as well, please?
I'll patch it after merge.
so:

                                                              0x0401 Ё 
[..]
0x00, 0x00, 0x00, 0x00, 0x00, 	  /*[000]   0x0404 Є */
0x00, 0x00, 0x00, 0x00, 0x00,        /*[000]   0x0406  І */
0x00, 0x00, 0x00, 0x00, 0x00,        /*[000]   0x0407  Ї */
                                                              0x0451 ё  
[..]
0x00, 0x00, 0x00, 0x00, 0x00, 	/*[000]   0x0454 є */
0x00, 0x00, 0x00, 0x00, 0x00,      /*[000]   0x0456  і */
0x00, 0x00, 0x00, 0x00, 0x00,      /*[000]   0x0457  ї */

Thank you!

@geo-mesh
Copy link
Author

geo-mesh commented Jan 6, 2024

Sir, can I ask you a little deal. Can you reserve 3 x 2 chars as well, please? I'll patch it after merge. so:

Thank you!

No problems. I can also write the code for these letters. The only thing I'm not sure yet is whether it's worth leaving serifs on the font? Serif looks beautiful, sans serif looks compact.

ЄІЇ_sans_serif ЄІЇ_with_serifs

@10der
Copy link
Contributor

10der commented Jan 6, 2024

wow! das ist fantastisch, thank you so much!

@10der
Copy link
Contributor

10der commented Jan 6, 2024

btw. compact - the best, IMHO

@megadimich
Copy link

This is a great idea! I'm waiting for a full-fledged implementation in awtrix!

@geo-mesh geo-mesh changed the title [FEATURE REQUEST] Cyrillic font (ready-made font and code) [FEATURE REQUEST] Cyrillic basic letters (ready-made font and code) Jan 7, 2024
@10der
Copy link
Contributor

10der commented Jan 19, 2024

@geo-mesh
glyphs after "в" wrong!

    {1074, 8, 5, 4, 0, -5}, /*[238]   0x432 в */
    {1081, 8, 4, 4, 0, -4}, /*[239]   0x433 г */

1074 + 5 = 1079 not 1081
all chars after - affected and looks like rubbish on the screen

@10der
Copy link
Contributor

10der commented Jan 19, 2024

here is test app for python + ./AwtrixFont.h

image

@10der
Copy link
Contributor

10der commented Jan 19, 2024

The python app emulate loading font and write font chars on canvas.
as u can see BIG cyr char looks OK
small - wrong

@10der
Copy link
Contributor

10der commented Jan 19, 2024

image

@10der
Copy link
Contributor

10der commented Jan 19, 2024

sources

@megadimich
Copy link

Great job! When can we see this on awtrix watch?

@10der
Copy link
Contributor

10der commented Jan 19, 2024

when topic starter help me to fix font. @geo-mesh

@10der
Copy link
Contributor

10der commented Jan 20, 2024

@geo-mesh https://discord.com/channels/546407049148366859/833683595670454443
done (as draft)

@geo-mesh
Copy link
Author

10der Thank you for your interest and work. At some point, I realized that it was not enough just to add the HEX code of the font to the file "AwtrixFont.h" so that it would work and I stopped being interested in it.
I do see a mistake with the letter "з". The correct code for it is:
0xC0, 0x20, 0x40, 0x20, 0xE0, /*[241] 0x437 з */
perhaps because of this, the glyphs may shift. I have already fixed the code in the header of the theme.
What software do you use to test the font on a PC? Is this Visual Studio Code + Python + add-on? I would like to test this on my PC before doing the firmware. I've been working on the font a lot, but I don't know how to test it on a PC and because this, interest is lost.

@10der
Copy link
Contributor

10der commented Jan 24, 2024

@geo-mesh https://tchapi.github.io/Adafruit-GFX-Font-Customiser/
btw, you can close this FR.

Blueforcer added a commit that referenced this issue Mar 12, 2024
- Rebranding AWTRIX Light to AWTRIX 3

- **Enhancements:**
  - Implemented median and mean filters for more accurate processing of raw data from LDR and BATT sensors.
  - Added Cyrillic support, limited to UPPERCASE letters. Issue #467 closed. 🇷🇺
  - Introduced overlays for weather animations accessible via the /settings API or customapp/notifications. Available overlays: clear, snow, drizzle, rain, storm, thunder, frost.  closes #454

- **Features:**
  - Added AP Mode timeout configuration via dev.json. ⏱️
  - The hostname isnt the same as the MQTT prefix anymore.  Instead you can set "hostname" in your dev.json.  🏠
  - Supports SSIDs with 32 characters. 🔒
  - Web port can now be changed via dev.json. 🌐
  - Unified firmware versions for peripherals, allowing Ulanzi firmware to control DFPlayer and read temperature sensors and vice versa. Only port mapping differs. DFPlayer can be enabled in dev.json. 🔄

- **Bug Fixes:**
  - Resolved issue where using custom apps and sending text in colored fragments prevented reverting to a single color. Issue #464 closed. 🐛
  - Fixed URL forwarding in the web interface. Issue #501 closed. 🔗

- **Miscellaneous:**
  - Added functionality to control the volume of the buzzer or DFPlayer via on-screen menu or settings API. 🔊
  - Enabled reset button on the back of Ulanzi; holding it for 5 seconds initiates a full reset of the AWTRIX firmware. 🔧
Blueforcer added a commit that referenced this issue Mar 12, 2024
- Rebranding AWTRIX Light to AWTRIX 3

- **Enhancements:**
  - Implemented median and mean filters for more accurate processing of raw data from LDR and BATT sensors.
  - Added Cyrillic support, limited to UPPERCASE letters. Issue #467 closed. 🇷🇺
  - Introduced overlays for weather animations accessible via the /settings API or customapp/notifications. Available overlays: clear, snow, drizzle, rain, storm, thunder, frost.  closes #454

- **Features:**
  - Added AP Mode timeout configuration via dev.json. ⏱️
  - The hostname isnt the same as the MQTT prefix anymore.  Instead you can set "hostname" in your dev.json.  🏠
  - Supports SSIDs with 32 characters. 🔒
  - Web port can now be changed via dev.json. 🌐
  - Unified firmware versions for peripherals, allowing Ulanzi firmware to control DFPlayer and read temperature sensors and vice versa. Only port mapping differs. DFPlayer can be enabled in dev.json. 🔄

- **Bug Fixes:**
  - Resolved issue where using custom apps and sending text in colored fragments prevented reverting to a single color. Issue #464 closed. 🐛
  - Fixed URL forwarding in the web interface. Issue #501 closed. 🔗

- **Miscellaneous:**
  - Added functionality to control the volume of the buzzer or DFPlayer via on-screen menu or settings API. 🔊
  - Enabled reset button on the back of Ulanzi; holding it for 5 seconds initiates a full reset of the AWTRIX firmware. 🔧
Blueforcer added a commit that referenced this issue Mar 12, 2024
- Rebranding AWTRIX Light to AWTRIX 3

- **Enhancements:**
  - Implemented median and mean filters for more accurate processing of raw data from LDR and BATT sensors.
  - Added Cyrillic support, limited to UPPERCASE letters. Issue #467 closed. 🇷🇺
  - Introduced overlays for weather animations accessible via the /settings API or customapp/notifications. Available overlays: clear, snow, drizzle, rain, storm, thunder, frost.  closes #454

- **Features:**
  - Added AP Mode timeout configuration via dev.json. ⏱️
  - The hostname isnt the same as the MQTT prefix anymore.  Instead you can set "hostname" in your dev.json.  🏠
  - Supports SSIDs with 32 characters. 🔒
  - Web port can now be changed via dev.json. 🌐
  - Unified firmware versions for peripherals, allowing Ulanzi firmware to control DFPlayer and read temperature sensors and vice versa. Only port mapping differs. DFPlayer can be enabled in dev.json. 🔄

- **Bug Fixes:**
  - Resolved issue where using custom apps and sending text in colored fragments prevented reverting to a single color. Issue #464 closed. 🐛
  - Fixed URL forwarding in the web interface. Issue #501 closed. 🔗

- **Miscellaneous:**
  - Added functionality to control the volume of the buzzer or DFPlayer via on-screen menu or settings API. 🔊
  - Enabled reset button on the back of Ulanzi; holding it for 5 seconds initiates a full reset of the AWTRIX firmware. 🔧
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants