[SOLVED] UI problem (translation)

I want to create an interface, write the names in my language (Russian) into the Text element, but when I try to specify the text in the editor field, I get an empty string.
When you try to specify the name of a field in your own language through the nodes, the error “character 1: Malformed file. Source files must be encoded with UTF-8. "
Is this an engine bug or is it necessary to add an appropriate font in Blender preferences?
The editor interface, as I understand it, should be recompiled with the required font anyway.

1 Like

Acute question. Also faced this problem.
By the way, in KOUI this problem is solved.

2 Likes

Same here. I made a feature request here.
It has been closed by Lubos himself. Maybe it was a different bug they found, as it is still not working for me. I described the bug in the link above. As you said: Empty string instead of Bulgarian characters.

1 Like

In the SDK folder there is a file for the canvas and it contains the default font (By the way, with Cyrillic characters. In folder \armsdk\armory\Assets).
However, it is not visible that this declared parameter would be used somewhere further in the code.

Found a solution! It’s simple, but not very obvious
You need to add the font to the assets and then select the asset with the font for the desired text. Those. it’s not somewhere in the settings.

UPD/
Rejoiced early.
In Armory2D, I see Cyrillic characters, but the application does not start. The console swears at a lot of errors.
2022-11-05 19_19_44

UPD 2 /
Decided.
The font file should not be in the bundle folder. Then everything works. The font is placed next to the blend file.
фыф553ппg

It’s not about the file’s location, it’s about its name.
Conflict with font_default.ttf

1 Like

Cannot edit the fields with keyboard directly under Manjaro. However when i type it in Mousepad and copy and paste it, it shows up. But at runtime only. Editing in Bulgarian letters not possible. Using DejaVuSans.TTF in blend folder imported and activated as asset as suggested. I have a switching keyboard with both English and Bulgarian layout. Maybe some OS issue.

1 Like

Another option here can help How to display, modify, and save values/variables in Armory 3D #armory3d - YouTube
No. will not help (

Try to output through the node to the desired element. It’s not very convenient, but it seems to work.
There is a noticeable text binding error, but this can also be solved with nodes (seemingly).
2022-11-05 21_20_25

1 Like

Hi. Is this a separate issue or was the original thread question unsolved?

I don’t know for sure, but it’s a clear UI problem when using languages with Cyrillic characters.

This issue was automatically closed because the linked PR was merged, which resolves the issue in the latest Armory2D main branch. However, the SDK still references a 10-month old version of Armory2D, so the fix isn’t yet included in the SDK. I notified Lubos about this and it will hopefully be fixed in the next SDK.

I’m not sure whether I understand you, is this an issue with Armory2D or does it also happen at runtime? If it also happens at runtime and you are sure that this isn’t an OS issue, please open an issue on the Zui repo with a simple example file and steps to reproduce it. Armory’s version of Zui should be recent enough to not have these glyph loading issues that happen in Armory2D at the moment. If it’s an issue with Armory2D, please try again once the fix is included. You can also build Armory2D yourself so you don’t have to wait, it’s relatively easy.

The Draw String node currently doesn’t automatically load any used glyphs, this is something that needs to be improved. Feel free to open an issue about this :slight_smile:

Could you please share the exact error message or even better open an issue about it?


A general remark: always make sure that the fonts you are using actually support the required glyphs/characters. In this specific case it doesn’t seem to be the fault of font_default.ttf, but perhaps someone with a font-specific problem reads this in the future.

1 Like

Hello M.,

But at runtime only

I can only see the letters at runtime if i write them with an external editor and then paste Ctrl V them.
Still i cannot see the pasted letters in Armory2D, they appear as blanks.

Armory2D should be fixed now if you update the SDK in the preferences (Update Submodules enabled). Can you please check again if the runtime issue is fixed too? What happens if you add a text input and then write into that at runtime (not in Armory2D)?

Updated SDK. Now i can´t even compile this anymore. Had to reinstall previous version after test.

Armory v2022.11 ($Id: ae8f32fd62b1cd01357859e5f0ca3ca89da1db16 $)
Using CPU for environment render (might be slow). Enable CUDA if possible.
Saved: ‘Globetrottel/armory3d_learn/build_cyril_nevrending/compiled/Assets/envmaps/env_World.jpg’
Time: 00:00.07 (Saving: 00:00.01)

Exporting Scene
Scene exported in 0.004s
ERROR: Globetrottel/armory3d_learn/build_cyril_nevrending/compiled/Shaders/deferred_light.frag.glsl:263: ‘env1’ : undeclared identifier
ERROR: Globetrottel/armory3d_learn/build_cyril_nevrending/compiled/Shaders/deferred_light.frag.glsl:263: ‘rgb’ : vector swizzle selection out of range
ERROR: Globetrottel/armory3d_learn/build_cyril_nevrending/compiled/Shaders/deferred_light.frag.glsl:263: ‘’ : missing #endif
ERROR: Globetrottel/armory3d_learn/build_cyril_nevrending/compiled/Shaders/deferred_light.frag.glsl:263: ‘’ : compilation terminated
ERROR: 4 compilation errors. No code generated.

SPIR-V is not generated for failed compile or link

Compiling shader 8 of 20 (deferred_light.frag.glsl) failed:
Shader compiler error.
(node:14380) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Shader compiler error.
(node:14380) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Finished in 2.115s
ERROR: Build failed, check console
cyril_nevrending.blend (884.3 KB)

Forgot to save the canvas of the blend, but does not make a difference.

cyril_nevrending.blend (884.9 KB)

I confirm! The update breaks something.

The shader compilation error should be fixed in the latest main branch, could you please check again?

Armory’s version of Zui seems recent enough to not have this issue at runtime, so I don’t really know why this is still happening. Unfortunately I can’t test your file since it’s only the .blend file (you also need to include the canvas).

What about this? Are the contents in the image above written at runtime or are they part of the canvas? Also, does Armory2D now work for you since your last update of the SDK?

Shader compilation now works. Cyrillic chars still do not get displayed in the creation field (slightly annoying, but acceptable).Text Align is inverted with Cyrillic chars. Text color is taken from the previous save. Overwriting color actually saves it for runtime use (kinda weird).

But at least it works at runtime, apart from the before mentioned quirks. Finally getting somewhere.


getting_somewhere.blend (884.9 KB)
Missing_in_Action.zip.hx (98.6 KB)

1 Like

Text field behaves differently now and broke my clock(s?).

I do not look for the Nixie now, but chill a bit first :–(

Should we redo everything on the KOUI?
There don’t seem to be any problems with localization there.

I was just comparing the work of ZUI and KOUI. And I liked the second much better.

Now there is such a thing with the input cursor when entering Cyrillic characters, this cursor, can correctly enter only “абвгде”, and then everything, it begins to live its own life
zui-text-input-bug

(At some point the game may even crash from text additions, deletions)

1 Like

At least now you can add more than one picture per screen.)
There was a time before it was impossible to do this. The ZUI is probably the most unfinished element of the weaponry. If you can - it is better not to use it. I liked the KOUI. And the problem with localization is solved there.
Only I do not remember how serious it is to work with text. Used it two years ago and KOUI was already more stable.