3

I've got a problem with writing Persian in Ubuntu, the problem is when I try to write mixed Persian and English text files in Gedit or VIM the lines starting with Persian characters start from right direction of the screen and it's hard to follow lines like this .

How can I change Ubuntu so it just starts lines from left?

enter image description here

here is a picture of MS Notepad I want them to be aligned like this

enter image description here

A.B.
  • 89,123
  • 21
  • 245
  • 323
  • You're writing in Farsi. Its written and read from right to left. Maybe you could align the text afterwards, but it's always going to start writing from the right of the screen. – amanthethy Aug 07 '14 at 02:09
  • I believe you could do that in MS Windows – Yahya Asadi Sheikhi Aug 07 '14 at 02:25
  • I'm sure you could format it after the fact. It'd be super easy if you were using a word processor and not a general purpose text editor. LibreOffice Writer would work. but as for typing it, its gonna come from right to left. If you don't know about Farsi, its written and read from RIGHT to LEFT and not from LEFT to RIGHT. Makes sense that it would type this way as well. – amanthethy Aug 07 '14 at 02:33
  • 4
    possible duplicate of [Switch text direction in GEdit](http://askubuntu.com/questions/522512/switch-text-direction-in-gedit) . You can use Unicode control LRM, `200e` – user.dz May 24 '15 at 12:35
  • @karel , agree with your point. updated my answer to more general and added a reference to bidi control in wikipedia if anyone looking for more advanced control. – user.dz Oct 06 '19 at 14:24
  • Just one thing should be noted: this solution (adding LRM) is not suitable if you don't want the text to be modified. using this approach might have side effect in other situations. This solution is not changing GEdit behavior but altering the text. This should be noted and kept in mind while applying this answer. – Mostafa Ahangarha Feb 14 '21 at 08:04

1 Answers1

1

Though this is outdated post, but I share the answer so the maybe it be useful for some.

What GEdit does is the right thing. you are writing in Persian which is a Right-to_Left script, so it should be displayed in the same way: right to left.

Adding LTM (Left-to-Right Marker) is not the solution since it Changes the direction of the line into Left-to-Right. If so, the line will be messed up if you add Latin characters in the middle of Persian text.

You don't need to be worried about the content. Since it is simply a text file, the presentation is the matter of software rendering preferences. You text is still a plain text without any specific direction.

Mostafa Ahangarha
  • 4,358
  • 7
  • 35
  • 51