rmkit-dev/rmkit

[simple] Problem with diacritics

tenJirka opened this issue · 10 comments

Hi, I'm trying to build a simple app with this nice and easy to use tool, but I find out, that if you try to create label for example with word "Dovolená", it will skip the letter "á" at the end (these special letters are pretty common in my language - Czech) and write only "Dovolen".

Tried with:
echo "label 150 150 150 400 Dovolená" | /opt/bin/simple

I guess it have probably something to do with encoding and it do not happen when the letter is not at the end of the text.

I would also like to ask, why are multiple spaces joining to one - for example "Wo rd" will end up as "Wo rd", I tried to use this to do some padding, but unsuccessfully.

I just find another bug, if you try to add any of these letters in upper case to label/button/etc., simple will crash. If it will be at the end of text, it will not, because it will not try render at all.
For example letters Č, Ř, Á will cause the crash.

raisjn commented

thank you, will investigate - am out of town until next week, though.

can you share some words that cause the crash?

raisjn commented

I found the issue with the end of line character - the rtrim function is bad. I'm sort of able to repro the crash with uppercase + diacritic, but it only happens if I do something like this:

"ČŘÁ" - this crashes
"ČŘÁs" - this doesn't crash

Okay, the behavior is actually weirder than I thought.
Word "ČŘÁ" do not crash for me, but it do not render.
Words "Dovolená Řecko" used as written crash.
Words "Dovolená řecko" is okay.
Word "Dovolená" and "Řecko" not used together doesn't crash.

raisjn commented

it has to do with the character widths - i'm not sure exactly what is going on yet but I tried out a few situations and was able to cause crashes. still debugging it, :-(

You are right, I can confirm that when I change font by system variable RMKIT_DEFAULT_FONT to /usr/share/fonts/ttf/noto/NotoSans-Bold.ttf, it wont crash.
So that's a workaround.

Hi, any news on this issue?
I am asking about the problem with cut ends of texts.
You mentioned the rtrim function. Maybe I can help you fix it? I can look more into it if you give me some more directions.

raisjn commented

the trim should be fixed, but the overall issue is still there

I will look into it more this week, sorry for the delay

this should be more addressed by 1a7887f. there is probably a better long term solution, though. will close this out when it lands in toltec