PDA

View Full Version : Unicode text is not appearing correctly in controls.



kcvinu
13-07-2017, 17:28
Hi there,
I am having an issue in my new gui sample project. I am experimenting with unicode and gui controls. My native language is not appearing correctly in gui contols. How to fix this issue. I am attaching my code and images of this issue. Please find attachments. Thanks in advance.

Petr Schreiber
13-07-2017, 17:37
Hi!,

the introduction of Unicode is in the beginning.
The UI module does not support it in 1.10.0.0, but it is something which can be improved in further iterations.

Full Unicode support will take some time - all string functions will need to have their Unicode counterparts + the GUI + file operations...


Petr

primo
16-07-2017, 12:27
Petr, it seems the unicode is not good for some opengl codes such as shaders, i know about that from some purebasic codes posted by some users especially the shaders, look
http://www.purebasic.fr/english/viewtopic.php?f=36&t=62179&p=495188&hilit=pjay#p495168
the code : Prototype.i glGetUniformLocation(Program.i, name.s) should be changed to Prototype.i glGetUniformLocation(Program.i, name.p-ascii)
the problem is that the newest purebasic version 5.6 is completely unicode, while many of the people prefer the previous version 5.44 which support unicode and ascii as well
yes there is functions in pb 5.6 allow using ascii from unicode but i think it is complex to use, and only the professionals can use it. the fact is that 99% of the users are normal amateur users and not a pro. in any programming language.
so i hope they make the new powerbasic a hybrid from unicode and ascii to allow using the two worlds without hassles

Petr Schreiber
17-07-2017, 14:54
Sure! There are no plans to go only Unicode.

Both approaches have their place, both will be preserved.
Pure Ascii occupies up to 2x less space, we want the programmer to decide when to use what.


Petr

kcvinu
18-07-2017, 09:45
Hi @Petr
In above comment, Petr said that enabling unicode for GUI elements need to do some work. I have a qustion. In my little knowledge, these are the functions which needs to create a window from scratch. I think GUI creating functions in thinBasic are wrapping these functions.
1. GetModuleHandle
2. LoadCursor
3. ExtractIconEx
4. CreateSolidBrush
5. GetSysColor
6. RegisterClassEx
7. CreateWindowEx

And this is my question. For enabling unicode in GUI elements, does replacing these functions with their unicode version will work ? I mean except functions in number 4 and 5, all of them have unicode versions with "W" in their names. And like Petr said, if you want to preserve ASCII enabled GUIs, then we can use a "Define Unicode" statement abovet the script. If that statement is there, then interpreter will call the CreateWindowExW function instead of CreateWindowEx function.