wxStyledTextCtrl (Scintilla) - Right To Left not working on macOS Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
User avatar
saifcoder
Knows some wx things
Knows some wx things
Posts: 37
Joined: Thu Nov 16, 2017 9:32 pm

wxStyledTextCtrl (Scintilla) - Right To Left not working on macOS

Post by saifcoder » Tue Jul 03, 2018 1:07 am

Hello,

Right to Left Text in wxStyledTextCtrl, and Bidirectional, work fine on Windows and Linux, But completely not working on macOS.

I known, Bidirectional is still Experimental in wxStyledTextCtrl, but why simple right to left not working on macOS ?

Tested :

wxWidgets 3.1.1 Stable, and from Github (master)
Static Unicode Build.

Windows 7, 10
TDM GCC 5.1.0
RTL : OK
BIDI : OK

Linux Debian, Ubuntu, CentOS
GTK 2 and 3
GCC (latest version)
RTL : OK
BIDI : OK

macOS 10.12 Sierra
Apple LLVM Clang 8.0
RTL : NO
BIDI : NO

Code: Select all

... = new wxStyledTextCtrl(... wxWANTS_CHARS | wxTE_PROCESS_ENTER | 
wxTE_PROCESS_TAB | wxBORDER_NONE | wxVERTICAL | 
wxRIGHT | SCI_CHARRIGHT | 
SCI_WORDRIGHTEND | SCI_CHARRIGHTEXTEND | SCI_WORDRIGHTENDEXTEND | 
SCI_SETMARGINRIGHT | SCI_WORDRIGHT | SCI_WORDRIGHTEXTEND | 
SCI_DELWORDRIGHT | SCI_DELWORDRIGHTEND | SCI_WORDPARTRIGHT | 
SCI_WORDPARTRIGHTEXTEND );

SetLayoutDirection(wxLayout_RightToLeft);
Thanks,
Attachments
stc_macos_rtl_prob.png
stc_macos_rtl_prob.png (55.79 KiB) Viewed 842 times
Debian 9 - GCC 6 - wxWidgets 3.1 U
Win 7 - GCC 5 - wxWidgets 3.1 U
Mac OS X 10.6 - GCC 4 - wxWidgets 3.1 U
i am in love with WX. Yes.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3409
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxStyledTextCtrl (Scintilla) - Right To Left not working on macOS

Post by ONEEYEMAN » Tue Jul 03, 2018 2:04 pm

Hi,
What locale do you have on you Mac?
Did you install any special fonts that should be used to display text?
Is internat sample works for you?
Do you see RTL text in the standard text editor on Mac?

Thank you.

User avatar
saifcoder
Knows some wx things
Knows some wx things
Posts: 37
Joined: Thu Nov 16, 2017 9:32 pm

Re: wxStyledTextCtrl (Scintilla) - Right To Left not working on macOS

Post by saifcoder » Wed Jul 04, 2018 2:05 pm

Hi,
What locale do you have on you Mac?
I test by English Local, and Arabic Local (RTL Language), but the result is the same.
Did you install any special fonts that should be used to display text?
No, i'm using the default installed fonts "Courier New", even if i change the font result still the same.
Is internat sample works for you?
The screenshot attached, is the STC Sample, as you can see, work fine in Windows and Linux, but not in macOS.
Do you see RTL text in the standard text editor on Mac?
Yes, its work fine, please see the new attachment.

My question, is not about Bidirectional Text, i know is still Experimental.. but why simple Right To Left Layout not working ?
Thank You,
Attachments
mac_os_textedit_vs_stc.png
mac_os_textedit_vs_stc.png (60.08 KiB) Viewed 780 times
Debian 9 - GCC 6 - wxWidgets 3.1 U
Win 7 - GCC 5 - wxWidgets 3.1 U
Mac OS X 10.6 - GCC 4 - wxWidgets 3.1 U
i am in love with WX. Yes.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3409
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxStyledTextCtrl (Scintilla) - Right To Left not working on macOS

Post by ONEEYEMAN » Wed Jul 04, 2018 3:24 pm

Hi,
saifcoder wrote: Hi,
What locale do you have on you Mac?
I test by English Local, and Arabic Local (RTL Language), but the result is the same.
If you need an RTL text, you should test under Arabic locale.
saifcoder wrote:
Did you install any special fonts that should be used to display text?
No, i'm using the default installed fonts "Courier New", even if i change the font result still the same.
Do you have a special Arabic font installed that is displaying Arabic characters?
saifcoder wrote:
Is internat sample works for you?
The screenshot attached, is the STC Sample, as you can see, work fine in Windows and Linux, but not in macOS.
I didn't ask for STC sample, didn't I?
saifcoder wrote:
Do you see RTL text in the standard text editor on Mac?
Yes, its work fine, please see the new attachment.

My question, is not about Bidirectional Text, i know is still Experimental.. but why simple Right To Left Layout not working ?
Thank You,
Can you go to the Scintilla website, download the Scintilla source code, compile and run the plain scintilla application? Does it work?
You should try the latest Scintilla sources to make sure everything works.

Thank you.

User avatar
saifcoder
Knows some wx things
Knows some wx things
Posts: 37
Joined: Thu Nov 16, 2017 9:32 pm

Re: wxStyledTextCtrl (Scintilla) - Right To Left not working on macOS

Post by saifcoder » Wed Jul 04, 2018 5:53 pm

I thing this won't fix, because Scintilla don't fully support RTL and Bidi on macOS Cocoa right now, and even if text is correctly align right, without Bidi is not helpful.

Also, there no open source version of SciTE for macOS.

www.scintilla.org
There is no open source version of SciTE for macOS but there is a commercial
version available through the App Store.
Finlay, i will move to wxRichTextCtrl on macOS, and wxStyledTextCtrl on Windows and Linux !

Thank you,
Debian 9 - GCC 6 - wxWidgets 3.1 U
Win 7 - GCC 5 - wxWidgets 3.1 U
Mac OS X 10.6 - GCC 4 - wxWidgets 3.1 U
i am in love with WX. Yes.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3409
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxStyledTextCtrl (Scintilla) - Right To Left not working on macOS

Post by ONEEYEMAN » Wed Jul 04, 2018 6:50 pm

Hi,
wxSTC is just a wrapper around Scintilla API.
So if there is no RTL support for Scintilla on OSX then it won't work for wxSTC.

Yes, you can try wxRTC on Mac and see if it helps.

Thank you.

Post Reply