Comments (10)
Thanks for your contribution! The offsets should continue from the main PixelItGlyphs font and then UTF letter assignments can be made in the Utf8ToAscii helper function. You can search the code for ๐ to find an example of how the mapping is done for this emoji.
For Russian letters you provided, we'll need to map Unicode symbols U+0410
.. U+044F
according to https://en.wikipedia.org/wiki/List_of_Unicode_characters#Cyrillic
By the way, did you create this font yourself or it is taken from some permissive source?
I can take a look later and create the mapping (since it's linear it can be done in a single case
statement similar to Latin1 Supplement)
from pixelit.
Hi, the range for the glyphs in UTF-8 should be D081 (ะ U+0401) to D197 (ั U+0457)
here's a placeholder for the contiguous range ะ..ั which just prints question marks instead of the glyphs:
case 0xD090 ... 0xD0BF: // Russian Cyrillic (Decimal 206-253)
result = 0x3F;
break;
case 0xD180 ... 0xD18F: // Russian Cyrillic (Decimal 254-269)
result = 0x3F;
break;
What is left is to add the offset (0x90 becomes 0xEE and so on) - I am also working on a patch, will let you know the right math once I have it working. For other non-contiguous symbols we'll have to add them individually or draw the missing ones
from pixelit.
Some more thoughts after playing around:
- the glyph number needs to be changed on the font object when updating the font to enable new letters
- setting the max number higher than 0xFF breaks the screen for me
- there's already 201 glyphs and the limit is 224 which is just 13 more symbols
- the pixelit font is 5px tall but some of the new letters are 7 pixels tall
- newly provided Cyrillic letters have a different drawing style than existing Latin matching ones (ABC for instance) - this might need adjustment once we figure out the rendering issue
- some offsets are off starting with ะท when previewing via https://tchapi.github.io/Adafruit-GFX-Font-Customiser/
With this, I was able to show some of the chars successfully:
So besides the minor bugs in the font itself I thing the issue with glyph limits is the biggest. I don't have much experience with the GFX Library - maybe @foorschtbar can comment on this. The last
attribute is uint16_t
according to the reference so it should be able to go higher than 256. The font customizer also has no problem displaying all the glyphs.
from pixelit.
UPD: as a temporary hack, since we're stuck with 1-byte encodings, I've hacked up a patch that replaces latin extended glyphs with your font - it can be found in this branch:
https://github.com/jekader/PixelIt/tree/cyrillic-font
This only covers the contiguous Russian alphabet mapping in Utf8ToAscii
at the moment for simplicity. All glyphs work fine (I've trimmed down everything to max 6 pixels high).
Feel free to build this branch and improve on it, should give you the result you need while we figure out a proper solution if one is even possible for embedded devices.
from pixelit.
I've added extended Cyrillic glyphs to my branch. Looks like า and า were missing from your font so I've created those and added them as well. Now all East-Slavic Cyrillic languages should fully work.
Looking at the patch, seems like having a separate repo which would rebase with each PixelIt release would be a reasonable solution: whoever needs a PixelIt with Cyrillic support can just install the relevant binary. WDYT? Alternatively, having a separate set of _cyrillic
image builds right in this repo is an option - also possible with minor refactoring of some of the sources and adding some build flags.
from pixelit.
Thanks for your contribution! The offsets should continue from the main PixelItGlyphs font and then UTF letter assignments can be made in the Utf8ToAscii helper function. You can search the code for ๐ to find an example of how the mapping is done for this emoji.
For Russian letters you provided, we'll need to map Unicode symbols
U+0410
..U+044F
according to https://en.wikipedia.org/wiki/List_of_Unicode_characters#CyrillicBy the way, did you create this font yourself or it is taken from some permissive source?
I can take a look later and create the mapping (since it's linear it can be done in a single
case
statement similar to Latin1 Supplement)
I created it myself and wrote the HEX code for it. At the moment, I have changed the encoding to UTF-16 and edited the glyphs settings. Does it look right now? Can you check it out? If not, write about it and I will fix it.
My font can also be changed by me for the convenience of reading it.
from pixelit.
const uint8_t PixelItBitmaps[] PROGMEM = {
.
.
0xC0, 0x40, 0x20, 0x40, 0xC0, // [ 93 | 125 | 0x7D] braceright (0x7D)
0x60, 0xC0, // [ 94 | 126 | 0x7E] asciitilde (0x7E)
// Basic Cyrillic (Decimal 1025-1111)
0xA0, 0x00, 0xE0, 0x80, 0xC0, 0x80, 0xE0, // [95 | 1025 | 0x401] ะ (0x401)
0x60, 0x80, 0xC0, 0x80, 0x60, // [96 | 1028 | 0x404] ะ (0x404)
0x80, 0x80, 0x80, 0x80, 0x80, // [97 | 1030 | 0x406] ะ (0x406)
0xA0, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, // [98 | 1031 | 0x407] ะ (0x407)
0xE0, 0xA0, 0xE0, 0xA0, 0xA0, // [99 | 1040 | 0x410] ะ (0x410)
const GFXglyph PixelItGlyphs[] PROGMEM = {
.
.
{411, 8, 5, 4, 0, -5}, // [ 93 | 125 | 0x7D] braceright (0x7D)
{416, 8, 2, 4, 0, -5}, // [ 94 | 126 | 0x7E] asciitilde (0x7E)
// Glyphs setting Basic Cyrillic (Decimal 1025-1111)
{418, 8, 7, 4, 0, -7}, // [95 | 1025 | 0x401] ะ (0x401)
{425, 8, 5, 4, 0, -5}, // [96 | 1028 | 0x404] ะ (0x404)
{430, 8, 5, 2, 0, -5}, // [97 | 1030 | 0x406] ะ (0x406)
{435, 8, 7, 4, 0, -7}, // [98 | 1031 | 0x407] ะ (0x407)
{442, 8, 5, 4, 0, -5}, // [99 | 1040 | 0x410] ะ (0x410)
jekader
I tried to test my font and added the first 5 lines of my Cyrillic font code. But my symbols ยซะ, ะ, ะ, ะ, ะยป are not displayed, instead I get an empty screen. I also set up the "Glyphs" offset according to the continuation of the line code [94]..
Also in the file " Tools.h " via "Utf8ToAscii" I added the following code:
case 1025 ... 1040: // Basic Cyrillic (Decimal 1025-1111)
result = ascii;
break;
But all to no avail.
Could you tell me what can be done to make it work? I'm not an expert, but I figured out how the pixel font is encoded in "HEX", what Decimal and ASCII are. And I really want my font to finally display on my pixel clock. I also spend a lot of time to redo the code of my Cyrillic font for the Pixelit project.
Thanks for any information.
from pixelit.
jekader
Thank you for your feedback and your work! Sorry for not responding earlier.
At some point, I realized that it was not enough just to add a HEX code for Cyrillic to make it work and my hands dropped.
As I understand it, you created a fork of the project and instead of extended Latin characters, you added Cyrillic for the experiment?
I still do not understand how the function works when entering a character from the keyboard for subsequent transmission to Utf8ToAscii and 1-byte encodings. It is configured in the src/Tools.h file ?
from pixelit.
Yes, correct. Tools.h
has a switch
statement which loops through user input chars in UTF-8 format and converts them to a symbol position in the font which is 0..255
from pixelit.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
from pixelit.
Related Issues (20)
- Color picker doesn't work HOT 1
- ESP32 d1_mini reconnection every few minutes HOT 1
- ESP32 d1_mini loose all settings after reboot HOT 1
- bme680 Reading Backwards? HOT 3
- Pixel HOT 1
- SAVE CONFIG button not clickable ESP32 d1mini esp32-d0wdq5 rev 3 HOT 27
- MQTT setScreen only works if the master topic ends with "/" HOT 1
- Is that correct? "Pin-Zuordnung: Unbekannter Pin" HOT 4
- Question/Discussion: Reduce MQTT "noise" HOT 5
- Black screen after update new firmware. 2.4.3 HOT 24
- Feature request: config backup/restore HOT 3
- MQTT message is to long HOT 15
- Unable to turn off LEDs HOT 18
- Feature request: Ulanzi TC001 buzzer support HOT 1
- Ulanzi TC001: Add option to disable battery screen on boot HOT 8
- Feature request: 64x32 LED matrix support HOT 1
- Node-red Warnung HOT 3
- Android Support ? HOT 1
- Display switches automatically on HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixelit.