Jump to content

Right To Left (RTL)/BiDi support


Recommended Posts

Hey Rick!

Some friends noticed that the text tool does not support RTL languages meaning that mixing Hebrew and English text together making the text almost unreadable.

I'll explaing a little about that issue:

Hebrew, Arabic and several other languages are written from right to left, as such there are several adjustments that should be made, unicode has a special definition for characters that are written in that direction, punctuation symbols are context related, lets say I want to write some text and the general directionality is LeftToRight, it should look something like that:

.Some Hebrew text

The reason that dot is in the beginning and not at the end is that I wrote the complete sentence just like it should look like but since that last symbol has no RTL unicode character after it the symbol is acting like an LTR symbol like the environment itself for the current line or text box.

The solution in this case would be to add the RLM mark at the end (http://www.fileformat.info/info/unicode/char/200f/index.htm).

Here are several examples of the sentence:

No RTL adjustments whatsoever: שלום עולם.

RLM at the end: שלום עולם.‏

RLO at the beginning (could be problematic when mixing RTL and LTR langs): ‮ שלום עולם Hello World.

‪RLE at the beginning (now everything is almost good but the dot is in the middle, when aligning to the right it usually works pretty good): ‫שלום עולם Hello World.

‪The best results would be RLE at the beginning and RLM at the end:

‫שלום עולם Hello World.‏

I would love to provide any further explanations if needed.

Kind regards,

‪Yaron Shahrabani.

Edited by Yaron
Link to comment
Share on other sites

You are correct that RTL, bidi, etc. are not faithfully supported or even taken into consideration by the Text tool. This is an artifact of when the Text tool was written, which dates back to before Paint.NET was even available in languages other than English. It makes several assumptions about layout of glyphs and lines with respect to the order they were typed in.

For the v4 release I'm planning to redo the Text tool so that it relies more heavily on DirectWrite, which is a new text layout and rendering system introduced in Windows 7 (it's also available for Vista). Right now Paint.NET is using it (DirectWrite) to render text (although not on XP of course), but does not rely on it for layout/positioning. It has support for pretty much any typographical scenario you can think of, and takes care of very important concerns related to hit testing, cursor placement, etc.

When you see an alpha or beta release of Paint.NET v4 show up (I don't have a date planned yet, mind you), you should definitely install it and help make sure that the Text tool is working properly.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Is DirectWire supported under Windows XP?

Meaning that version 4.0 will work on XP fluently?

BTW I added a Hebrew translation to Pinta for Linux and now there's finally a version that has full RTL support ☺, can you please take a look at it and see if you can possibly create an RTL mode for Paint.NET as well?

Kind regards,

Yaron Shahrabani.

Link to comment
Share on other sites

  • 2 years later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...