Closed StrandedAlien closed 1 year ago
Hi, yes this is totally possible.
The issue is that some glyphs in the font aren't loaded. I'm a bit confused though why Zui doesn't already do this by default, since dynamicGlyphLoad
is true in both Armory2D's and Armory's versions of Zui... Even in the case that it was working already, I guess it would be slightly faster to disable dynamic glyph loading and let the user add additional character sets in the 2D editor that are loaded once when the canvas is created. The user could then choose/create presets for them. What do you think about this? Do you prefer the dynamic approach (assuming that it would work) or the static one?
Btw, make sure that the font you are using supports cyrillic characters!
Moin,
Thanks for the fast and positive answer. Dynamic? Static? i´m not really sure what the consequences would be, as i am NOT a coder, but just a Blender user with very basic coding skills. Could you make it work out of the box, so that i do not have to make settings in some menus? You could always add a more nifty approach, once you have some time left.
Dynamic? Static?
Could you make it work out of the box, so that i do not have to make settings in some menus?
I hope so, I will try to find the reason why it doesn't work this way already (it looks like it should...)
Are you sure that your font supports cyrillic? I just tried it with a canvas text object, and with the default font it doesn't work correctly (the screenshots are from inside a running Armory game, but it looks the same in the 2D editor):
But with a font that supports cyrillic, everything displays fine:
So it doesn't seem like there is a Zui/Armory2D/canvas issue here.
I used OpenSans-Regular.TTF and in my first post there is the full char table containing cyrillic. The link has been fixed, it works for french. See link. I would like to try with the font you used, what designation has it? Where can i get it?
I'm using the font Montserrat, which you can get from Google Fonts for example. I know from earlier tests in my own UI library that it supports cyrillic which is the reason I've chosen it this time as well. I now downloaded Open Sans (also from Google Fonts where it says it supports cyrillic), and it indeed works for me as well:
I'm not sure what's the source of your table above, but cyrillic letters seem to start at U+0400 according to Wikipedia, not at U+00C0 like it's shown in your table (also note that I'm talking about unicode and not about ASCII, Kha uses stb_truetype which I think works with unicode). Perhaps your using a wrong/old version of the font?
Unfortunately it still does not work for me in Armory2D. I cannot even see any letter when typing in cyrillic and it seems to displace already typed English letters. They seem to disappear, cause i cannot see the anymore after the first cyrillic letter typed. It works with any other app on Manjaro. Mousepad, Inkscape, Abiword, etc. no issues at all. How do i tell Armory2D to use Unicode? And please click the link from my first post to see where and what i am trying to avoid misunderstanding. Dankeschön.
I found the issue, the reason it worked for me is that I have symlinked Armory2D's version of Zui with Armory's version of Zui and the latter was checked out in a much newer version than what Armory2D is configured to use (and because both versions are linked, both Armory and Armory2D actually used the newer version in my case). I didn't realize this before, and when I check out Armory2D's correct Zui version I can reproduce the problem.
Your issue was already fixed in https://github.com/armory3d/zui/commit/c24daaf245919429bae588cda7ab853248eef385, but it isn't included in Armory2D's version of Zui yet. It will be included after https://github.com/armory3d/armory2d/pull/70 is merged, but then it also needs to be included in the SDK so it may take a while.
Thanks for your patience :)
Hey @luboslenco, could you please update Armory2D in the SDK so that https://github.com/armory3d/armory2d/pull/70 gets included in the SDK? I can also open PRs for that if you want, but I think it's faster if you're doing it compared to me opening 2 PRs in sequence for the armory_tools and SDK repos. Thanks :)
Hello, would it be possible to add support for the higher ascii number letters in a font?
It is crucial to be able to display Cyrillic characters.The letter A of the western alphabet is at Ascii 65 whereas te Cyrillic letters start at 192. See screenshot. I am talking of canvas support. It works for French or German, etc. diacritics because they are in the first (65-) Ascii range. No dice for Cyrillic letters.
Also see my post here for comparison: Armory3D Forum link (url)https://forums.armory3d.org/t/how-can-i-put-characters-with-accents-in-canvas-text-field/4956