1. GUI with RTL and BiDi support?
- Posted by GreenEuphorian Dec 15, 2012
- 1585 views
Hi
does anyone know if there is any GUI usable from an Euphoria program that also supports RTL (Right-to-Left) languages and text bidirectionality? I know for sure that Qt and GTK support these features, but are there Euphoria bindings for them? Or, are they planned?
Thanks
2. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 15, 2012
- 1524 views
Hi
does anyone know if there is any GUI usable from an Euphoria program that also supports RTL (Right-to-Left) languages and text bidirectionality? I know for sure that Qt and GTK support these features, but are there Euphoria bindings for them? Or, are they planned?
Thanks
I have seen Arabic and Hebrew support at almost any software where there is allowance for European languages. This, I believe, is ANSI (one byte per character) support. You should, therefore, find it easy to integrate your needs with current implementations of euphoria using Ansi.
Euphoria has a 4 bytes/per character and has availability of several Peek/Poke operations with memory. Therefore, you should be able to integrate your needs using 16 bit Unicode and Peek/Poke operations.
As of Unicode 6.1, the Arabic script is contained in the following blocks:
Arabic (0600—06FF, 225 characters) Arabic Supplement (0750—077F, 48 characters) Arabic Extended-A (08A0—08FF, 39 characters) Arabic Presentation Forms-A (FB50—FDFF, 608 characters) Arabic Presentation Forms-B (FE70—FEFF, 140 characters) Rumi Numeral Symbols (10E60—10E7F, 31 characters) Arabic Mathematical Alphabetic Symbols (1EE00—1EEFF, 143 characters)
Hebrew is at Hex 0580
I could not easily find the Persian and Urdu range, but if you look into it you will find the exact 16 bit Unicode character set for these. 16 bit Unicode fully supports bidirectional text, so you would be able to use the Peek/Poke facilities and create 16 bit characters. Your major difficulty will be in using some of the functions that manipulate character strings. Euphoria, as far as I know, has not addressed this area of Unicode work. You will have to create your substitute variants of the one byte routes, converting them to two byte functions. Note that the some Arabic set extensions resides above FFFF, so if you intend to use those as well, you should start with 32 bits per character, which Euphoria is quite capable of.
3. Re: GUI with RTL and BiDi support
- Posted by GreenEuphorian Dec 15, 2012
- 1528 views
You see, you may be able to use the character set of the language you need, but this does not guarantee RTL support. I have experienced, in other languages, some GUIs which can reproduce the individual characters from an RTL language, but cannot correctly reproduce the words and the sentences. That is because those GUIs do not support Right-to-Left languages, and consequently those characters or words are displayed backwards.
What about Euphoria bindings for Qt or GTK? Is anyone thinking of working on them?
4. Re: GUI with RTL and BiDi support
- Posted by _tom (admin) Dec 15, 2012
- 1547 views
For answers to questions like this, check "The Archive," that's the link to the right under Misc Menu.
- Irv Mullins has a GTK wrapper.
https://sites.google.com/site/euphoriagtk/Home
- Ne1uno has a Qt wrapper.
5. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 15, 2012
- 1506 views
You see, you may be able to use the character set of the language you need, but this does not guarantee RTL support. I have experienced, in other languages, some GUIs which can reproduce the individual characters from an RTL language, but cannot correctly reproduce the words and the sentences. That is because those GUIs do not support Right-to-Left languages, and consequently those characters or words are displayed backwards.
What about Euphoria bindings for Qt or GTK? Is anyone thinking of working on them?
You can download the QT4 wrapper, which according to the author is incomplete, and I can almost guarantee that it does not include the Unicode classes. I have not looked at the GTK wrapper or worked with it. However, my general experience is that people talk about Unicode more than actually implement it, and RTL is another big hurdle. You are also faced with the choice of UTF-8 favoured by the Linux crowd, and Unicode LE16 favoured by Microsoft in windows XP/7/8. If you decide to go the windows route, you can try using the Peek/Pokes, and use the Win32lib and modify it to suit your needs. At Peek/Poke level (16 bits) you would be able to write routines to change (where necessary) some of the work in win32lib. The preciseness of 16 bit words is something I love. There are ready made free C libraries available for changing from UTF-8 to LE16 and vice versa. You might get more replies if you post the actual RTL you are talking about.
7. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 15, 2012
- 1539 views
You see, you may be able to use the character set of the language you need, but this does not guarantee RTL support. I have experienced, in other languages, some GUIs which can reproduce the individual characters from an RTL language, but cannot correctly reproduce the words and the sentences. That is because those GUIs do not support Right-to-Left languages, and consequently those characters or words are displayed backwards.
What about Euphoria bindings for Qt or GTK? Is anyone thinking of working on them?
I just looked the latest Euphoria wrapper for GTK. It uses UTF-8 for Unicode input. You can easily compose using a Unicode word processor which allows UTF-8 characters, and do Cut and paste into label (see Test 117). Write a program and test some output in your language and see if it comes out OK or reversed.
8. Re: GUI with RTL and BiDi support
- Posted by GreenEuphorian Dec 15, 2012
- 1444 views
Sorry, maybe I am missing something, but why do you suggest that I compose the text in a word processor and then paste it into the GUI window? Does this mean that I cannot input the text directly into those Gtk windows from my keyboard? Because, this is exactly what I would need them for... managing user input directly. But perhaps, as I said, I did not understand properly what you said. Could you please clarify?
Thanks
9. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 15, 2012
- 1527 views
Google transliteration IME is available for
Arabic, Hebrew and Urdu and Persian.
To the best of my knowledge it generates UTF-8 characters.
Being phonetic, it is easy to use for typing from your regular keyboard.
I use the Hindi version for a lot of my work.
10. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 15, 2012
- 1453 views
Sorry, maybe I am missing something, but why do you suggest that I compose the text in a word processor and then paste it into the GUI window? Does this mean that I cannot input the text directly into those Gtk windows from my keyboard? Because, this is exactly what I would need them for... managing user input directly. But perhaps, as I said, I did not understand properly what you said. Could you please clarify?
Thanks
If you look at the GTK wrapper Guide, it shows you how to input using Hex number in euphoria; However, it would be far easier to have a Unicode text processor open at the same time and compose your special text there and do a CP as demonstrated. I have tried LE16 input in some work but it is difficult to save. UTF-8 would be ealier to save.
11. Re: GUI with RTL and BiDi support
- Posted by GreenEuphorian Dec 15, 2012
- 1444 views
However, it would be far easier to have a Unicode text processor open at the same time and compose your special text there and do a CP as demonstrated.
Thanks, I will look into it. I just hope I can find a way to input and edit the text without much hassle, and without the need for an external editor. My goal in wanting to use the GUI toolkit was precisely inputting and editing text within simple text windows!
12. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 15, 2012
- 1438 views
However, it would be far easier to have a Unicode text processor open at the same time and compose your special text there and do a CP as demonstrated.
Thanks, I will look into it. I just hope I can find a way to input and edit the text without much hassle, and without the need for an external editor. My goal in wanting to use the GUI toolkit was precisely inputting and editing text within simple text windows!
You may try and do the whole program using Notepad plus plus, but I would recommend using a simple text editor like wordpad and adding the CP to it. You still have not mentioned what language you are trying to input. If I knew what RTL text, I might be able to suggest an ANSI simple font for it, and much easier way.
In any case, you will have separate out Euphoria code and special text; that would be the only way to maintain sanity.
13. Re: GUI with RTL and BiDi support
- Posted by ne1uno Dec 16, 2012
- 1479 views
You see, you may be able to use the character set of the language you need, but this does not guarantee RTL support. I have experienced, in other languages, some GUIs which can reproduce the individual characters from an RTL language, but cannot correctly reproduce the words and the sentences. That is because those GUIs do not support Right-to-Left languages, and consequently those characters or words are displayed backwards.
What about Euphoria bindings for Qt or GTK? Is anyone thinking of working on them?
You can download the QT4 wrapper, which according to the author is incomplete, and I can almost guarantee that it does not include the Unicode classes. I have not looked at the GTK wrapper or worked with it. However, my general experience is that people talk about Unicode more than actually implement it, and RTL is another big hurdle.
sounds like you have zeros reason for asserting unicode or bidirectional text is not supported in euqt, and even less for assertions about any of the the GTK wrappers.
Qt is fully unicode and language agnostic. anywhere it isn't is a bug. wish I could say the same for euqt. patches accepted.
- ~Qt_LeftToRight
- ~Qt_RightToLeft
these ~Qt_LayoutDirection constants are used to set the properties on widgets, that part of it should present few problems, I am not sure how line ends and a few other details would be handled. Qt also has a translation feature that I have not really tested out but should work as expected from euphoria. TR()
anyway in fact, you are correct that euqt is not unicode capable. only because the text is converted to ansi on the way in and on the way out of widgets. a relatively simple, *guessing*, change to that section of the code could preserve the unicode. utf8 could simply be handled as binary. since euphoria is not really aware of unicode in any meaningful way yet, especially u16, you would have to addopt one of the unicode libs from the archive or from the net.
I would be surrprized if GTK and WxEuphoria text widgets were not equally capable of lefttoright and unicode already. their wrappers are more complete and more widely used, if user feedback is any indication.
feel free to enter bug reports or feature requests for any of the GUI wrappers at their websites, or use the ticket system on openeuphoria for euphoria itself. this has the effect of raising the priority. Unicode is something everyone wishes was already done well and was easy to implement. it isn't. you can search the forum for past discussions too.
14. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 16, 2012
- 1494 views
I would be surrprized if GTK and WxEuphoria text widgets were not equally capable of lefttoright and unicode already. their wrappers are more complete and more widely used, if user feedback is any indication.
GTK: I have already commented that on paper at least and based on test 117 given by the GTK wrapper author, you should be able to enter utf-8 text in a Label. The methodology recommended by him and I agree there, is to use C/P from a utf-8 word processor.
wxEuphoria: I use wxeuphoria, and have requested the release using the latest wxWidgets library version 2.9. wxPython has implemented it and I am waiting patiently for the release of wxEuphoria based on the latest wxWidgets library. That is has one that has full Unicode support.
I am already using and composing programs using wxEuphoria with Hindi menus, labels, etc., but using the old ANSI input method where the English keyboard is altered to accept input Hindi font. This is a one byte solution and NOT UTF-8. Hindi is also a left to right language. If there is a similar Ansi one byte Urdu or Arabic or Persian font, it can be easily implemented and the client will get going with his work. He has unfortunately not chosen to give the name of the language, so I cannot help more.
So this is what I am doing:
I write my GUI code in current wxEuphria (version 17, which uses wxWidgets 2.8.7. I use Hindi Saral font
http://www.freeuniquefonts.com/font-9610-hindi_saral_1.html for the Hindi Menu and labels., etc The Saral font has directions for changing the use of the standard keyboard, so the whole process is easy. Unfortunately I do not know any Right to Left scripts (languages) to attempt or even test, and I do not have knowledge of such (one byte) fonts although I am sure they exist in Arabic, Persian and Urdu at least and most probably in Hebrew as well. That is what the client could and should be using right away.
When Euphoria releases a later version of wxEuphoria using wxWidgets 2.9, I will attempt to convert all my work to Unicode. I have been assured by one of the developers that he can use wxwidgets 2.9 in his development work for wxEuphoria. I still have concerns of using either utf-8 or LE16 Unicode within a program, but can only wait for the new release to test.
Forked into: EuGTK and UTF-8
15. Re: GUI with RTL and BiDi support
- Posted by GreenEuphorian Dec 16, 2012
- 1372 views
I would be surrprized if GTK and WxEuphoria text widgets were not equally capable of lefttoright and unicode already.
I had read the wxWidgets documentation a while back, and it said that Right-to-Left support was incomplete. It worked on Windows but not on Linux. Moreover, BiDi, which means supporting on the same line texts from languages having different directions (for example, English and Hebrew), was not supported at all. So wxEuphoria is out of the contest, for the time being.
The best (and perhaps only) cross-implementations of RTL and BiDi in GUI toolkits are Gtk and Qt.
16. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 16, 2012
- 1380 views
I would be surrprized if GTK and WxEuphoria text widgets were not equally capable of lefttoright and unicode already.
I had read the wxWidgets documentation a while back, and it said that Right-to-Left support was incomplete. It worked on Windows but not on Linux. Moreover, BiDi, which means supporting on the same line texts from languages having different directions (for example, English and Hebrew), was not supported at all. So wxEuphoria is out of the contest, for the time being.
The best (and perhaps only) cross-implementations of RTL and BiDi in GUI toolkits are Gtk and Qt.
wxWidgets 2.9.4 Released 2012-07-09
wxWidgets 2.9.4 has been officially released. ...
2.9 series bring many improvements compared to 2.8 series such as much better and simpler to use support for Unicode and the new wxOSX/Cocoa port, suitable for development of 64 bit GUI applications under OS X, as well as a huge number of other new features and bug fixes. Compared to the previous 2.9.3 release, the most important change in this release is beta-level support for GTK+ 3 in wxGTK port. .....
wxEuphoria using wxWidgets 2.9.4 is underdevelopment right now.
17. Re: GUI with RTL and BiDi support
- Posted by GreenEuphorian Dec 17, 2012
- 1339 views
Any mention of RTL and BiDi support in wxWidgets 2.9.4?
18. Re: GUI with RTL and BiDi support
- Posted by mattlewis (admin) Dec 17, 2012
- 1379 views
wxEuphoria: I use wxeuphoria, and have requested the release using the latest wxWidgets library version 2.9. wxPython has implemented it and I am waiting patiently for the release of wxEuphoria based on the latest wxWidgets library. That is has one that has full Unicode support.
wxEuphoria has been fully unicode for some time. I believe that the way to get RTL working is to create a wxLocale object. It's not well documented by wxEuphoria, but the wxWidgets documentation is here. Basically, I think it should look like this:
constant HEBREW = create( wxLocale, wxLANGUAGE_HEBREW )
I haven't tested this.
Matt
19. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 17, 2012
- 1386 views
wxEuphoria: I use wxeuphoria, and have requested the release using the latest wxWidgets library version 2.9. wxPython has implemented it and I am waiting patiently for the release of wxEuphoria based on the latest wxWidgets library. That is has one that has full Unicode support.
wxEuphoria has been fully unicode for some time. I believe that the way to get RTL working is to create a wxLocale object. It's not well documented by wxEuphoria, but the wxWidgets documentation is here. Basically, I think it should look like this:
constant HEBREW = create( wxLocale, wxLANGUAGE_HEBREW )
I haven't tested this.
Matt
Whether or not the client tries his RTL, I am going to try this
constant HINDI = create( wxLocale, wxLANGUAGE_HINDI )
Matt: I need a few more golden code lines from you to try and continue from there.
If it it works, I will put out for everybody a good looking demo for two Indic languages.
20. Re: GUI with RTL and BiDi support
- Posted by mattlewis (admin) Dec 17, 2012
- 1342 views
Whether or not the client tries his RTL, I am going to try this
constant HINDI = create( wxLocale, wxLANGUAGE_HINDI )
Matt: I need a few more golden code lines from you to try and continue from there.
If it it works, I will put out for everybody a good looking demo for two Indic languages.
What else are you looking for? What operating system are you using? I ask, because the underlying unicode implementation will be different. On Windows, of course, it's all UTF-16, and on Linux it's UTF-32. There are also functions to convert from / to UTF-8 (to_utf8 and from_utf8) which you can use to convert UTF-8 into whatever the native system uses.
If the code points are the same in UTF-16 and UTF-32, then I think it won't matter from the point of view of your euphoria code, since both are represented by euphoria atoms.
Matt
21. Re: GUI with RTL and BiDi support
- Posted by EUWX Dec 17, 2012
- 1308 views
Whether or not the client tries his RTL, I am going to try this
constant HINDI = create( wxLocale, wxLANGUAGE_HINDI )
Matt: I need a few more golden code lines from you to try and continue from there.
If it it works, I will put out for everybody a good looking demo for two Indic languages.
What else are you looking for? What operating system are you using? I ask, because the underlying unicode implementation will be different. On Windows, of course, it's all UTF-16, and on Linux it's UTF-32. There are also functions to convert from / to UTF-8 (to_utf8 and from_utf8) which you can use to convert UTF-8 into whatever the native system uses.
If the code points are the same in UTF-16 and UTF-32, then I think it won't matter from the point of view of your euphoria code, since both are represented by euphoria atoms.
Matt
I am working under Windows XP and I have Windows 7 installed in another Partition. In a few days, I will activate Ubuntu (or whatever Linux distro you suggest) on a separate drive and try wxEuphoria on Linux with the intention of moving on to Raspbain (a Debian variant) on Raspberry Pi. I have two PIs, and Raspbian is already running and "startx" command gets me into their Windows environment. I also have Bodhi Linux which has special Raspberry Pi ISO available. I might install a multi-boot of several Linux distros on a 32GB SD for experimenting with Euphoria, wxEuphoria under Linux working on Raspberry PI.
At present the "sudo" language is akin to learning sumo wrestling but I will wrestle with Linux. I am comfortable with old DOS and the new Console mode in windows, so it should not be too difficult to learn "sudo apt-get" and whatever else Linus and his gang (and you) throw at me.
BTW, did you hear about the new Linux 3.7 release? They have got over the difficulties with various versions of ARM processor and this new release promises to be as friendly under ARM processors as under i86 and the Apple processors.
22. Re: GUI with RTL and BiDi support
- Posted by GreenEuphorian Dec 18, 2012
- 1343 views
I can now confirm with certainty that wxWidgets does NOT support BiDi. It also seems that, unfortunately, it is not even on their roadmap. See: https://groups.google.com/forum/?fromgroups=#!topic/wx-discuss/2Z1m2j0P8WE