Subscribe (RSS)

Quick Links

Recent Posts

Tags

Categories

Archive

About Actipro

Actipro Software has been creating .NET user interface control products for Windows Forms since its inception. More recently, Actipro has become a pioneer in the .NET 3.0 WPF control development arena.
Friday, 8 August 2008 09:31 by Bill Henning

SyntaxEditor for WPF will support bi-directional text (Arabic, etc.)

As I mentioned in the previous blog post, we've been working on core editing functionality for the WPF version of SyntaxEditor.  One feature that isn't in our WinForms version but that we always wanted to add is support for right-to-left languages inline with code.

Bi-directional display of text is a tricky thing because as soon as you enter a sequence of right-to-left characters such as Arabic or Hebrew, the entire sequence is flipped over and directional left/right arrow keys move the caret in the opposite direction.

 Bidi

SyntaxEditor for WPF showing the partial selection of some Arabic text

So in the screenshot above, say you have the caret at the left quote (fourth character) on line 6.  If you press your right arrow, the caret jumps to just before the right quote after the Arabic "Hello world" text, since this is considered "before" the Arabic sequence of characters.  If you press right arrow again, it moves one character to the left, and into the Arabic section.  This continues until you reach the leftmost side of the Arabic sequence, and the caret moves to the right quote again.  From that point on, right arrow moves to the right since it is back in left-to-right mode.

In the screenshot, the selection was anchored at the start of the "SyntaxEditor" word on line 5 and then the caret was moved down to line 6 into the Arabic sequence of characters.  You can see how the selection properly splits to show the contiguous sequence of characters that are selected.

Tags:   ,
Categories:   Actipro | In development | WPF
Actions:   E-mail | Permalink | Comments (1) | Comment RSS



Related posts

Comments

Mike Strobel said:

While I tend to advocate using English in all source code and comments, the geek inside of me can't help but be impressed Smile.

August 8. 2008 10:29

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]