2

I have some text in Latin script (English transcription of Farsi) that I would like to display right-to-left in ordinary text documents (and on my iPod) – is that possible? How?

Here’s an example of some text I’d like to reverse (the second row):

تو آسمون عشقم تو بودی ستاره ی من تو بودی
To asemoone eshqam to budi, Setareye man to budi

I first tried some online text mirroring tools but they either just place the letters in reverse order without mirroring them (idub ot nam eyerateS ,idub ot maqhse enoomesa oT) or replace them with other characters that may or may not resemble a mirror image of the original characters (ibud oƚ nɒm ɘyɘɿɒƚɘƧ ,ibud oƚ mɒpʜƨɘ ɘnoomɘƨɒ oT). Both solutions produced text that was (to me) more difficult to read than truly mirrored text.

I then tried adding right-to-left unicode marks (U+200E) after every character but that also just reversed the order of the characters, not the characters themselves (‏‏‏‏no example available, the effect is erased when pasted into superuser.com, but it looks like the first online example above).

Why would you want to do something like this? – In my case I have some song texts in Farsi with English transcription and it would be very helpful if the transcription flowed like the original text so that I can follow them simultaneously.

  • Are you confident your audience will be able to "read" the mirrored text well enough? I think it is doable, but not a given. I don't think a text document will do the trick just like that. Maybe if you find a mirrored font, and combine that with your reverse order tool. The easiest approach could be having the two types of text (Farsi and Latin) on separate layers in Photoshop or Gimp and simply mirror a pixel version of the latin text. The resulting image should display on most devices. – TheUser1024 Jun 15 '14 at 10:37
  • I completely concur: mirroring is easy with images. Even if you manage to find a mirrored font for your PC, you may not be able to use it in your iPod; whereas images can be guaranteed to display. Of course the documents will be a lot bigger, but I would think that a price worth paying for the effort saved. – AFH Jun 15 '14 at 11:06
  • By the way, I’m on a Mac (OS X 10.6.8), but if needed I can do the transformation in Windows, if it will survive copy-pasting from a virutal machine or being sent by email. – Elias Mossholm Jun 15 '14 at 11:06
  • > Are you confident your audience will be able to "read" the mirrored text well enough? @TheUser1024 Since the audience is me – yes! ;) – Elias Mossholm Jun 15 '14 at 11:13
  • TheUser1024, @AFH Images won’t do – the text must be mirrored in iTunes and on the iPod too, so that I can follow the lyrics while listening to the songs. A mirrored font would work in formatted text documents but I doubt it would be feasible in iTunes / on the iPod. What I would need is a solution that works in a pure .txt document on any platform, then it should be fine in iTunes / on the iPod too. – Elias Mossholm Jun 15 '14 at 11:15
  • @AFH The reasone a mirrored font wouldn’t work is that I’m using the built in function in the music player to show the associated lyrics. It would work if I added the the image to the gallery and switched there while listening to the song, but it would be nice to have it all in the music player, just like I have for all the other songs. – Elias Mossholm Jun 15 '14 at 11:19
  • @EliasMossholm: Phew, pure text might turn out to be a deal breaker here. As AFH mentioned even with a font it will not be robust, but without a font i doubt it is doable. Can you maybe use some album art function to display images in your context? I could also imagine that you could mirror text in html using CSS. – TheUser1024 Jun 15 '14 at 11:20
  • @EliasMossholm: The neat site you linked simply fakes it. `ƚƨɘƚ` and `test` are not actually symmetrical, but that approach would work in your scenario i guess. The author of that site might have a good lookup table for you, as this is not "meant to be" used like this, it is a sweet and dirty hack. :-) – TheUser1024 Jun 15 '14 at 11:35
  • @TheUser1024 I think the album art would make it really hard to read, but theoretically it should be possible. Available screen area is about 640×640 px. The lyrics is 88 rows long, I could probably bring it down to 50 by combining rows. That leaves 10–12 px row height (depending on padding) which is more than some LED displays use but given that the same area fits around 17 rows today (when showing the lyrics), and that text is already a tad small, it would be uncomfortably small to read in practice. But bonus star for a solution that, while uncomfortable, would actually work! – Elias Mossholm Jun 15 '14 at 12:02
  • I’m also not sure the album art uses the entire resolution, some of it is a bit fuzzy, but that might just be poor image quality to start with. – Elias Mossholm Jun 15 '14 at 12:03
  • 1
    Reversing text direction (which is all that the title refers to) might be meaningful in some contexts, and easy. Mirroring letters is abnormal for any writing system (except for the mirroring of some punctuation that is handled in a special way in the bidirectional algorithm. Who would recognize mirrored Latin letters better than normal letters? – Jukka K. Korpela Jun 15 '14 at 12:04
  • > The neat site you linked simply fakes it. ƚƨɘƚ and test are not actually symmetrical… @TheUser1024 Yes, and that put me off a bit – while some characters look great I tend to get stuck when reading the ones like ƚ, which is an entirely different letter and my brain interprets it as such too, it just (unforunately) looks like gibberish. It’s like trying to read a really poorly crafted font ;). – Elias Mossholm Jun 15 '14 at 12:11
  • @JukkaK.Korpela It certainly isn’t normal, but it’s mostly a matter of habit, and in this case it would be helpful as a support when trying to decipher the Farsi letters which read from right-to-left. _(But as a tounge-in-cheek answer to your question who would read mirrored letters better than normal ones – [Leonardo da Vinci seems to have had no problem doing so.](https://upload.wikimedia.org/wikipedia/commons/c/c9/Da_Vinci_Studies_of_Embryos_Luc_Viatour.jpg))_ – Elias Mossholm Jun 15 '14 at 12:19
  • @TheUser1024 Maybe the simple answer is – it cannot be done at the moment. But I appreciate your efforts, and especially the mirrored font suggestion felt promising, had iTunes/iPod Music app only supported formatted text. – Elias Mossholm Jun 15 '14 at 12:22

2 Answers2

2

Reversing text direction is possible in plain text, using control characters for the purpose. But the body of the question (unlike the title) also refers to mirroring of characters. Then the answer is negative. For most characters, there is no corresponding mirrored character, since such characters are not used in any normal writing system.

Jukka K. Korpela
  • 5,035
  • 2
  • 20
  • 33
  • Yes, I’ll just have to practice my Farsi reading skills. At the moment I cannot keep up with the pace of the music being sung, which is why the transcription would have helped (it still helps now, but then I cannot follow the Farsi text simultaneously), but I’ll probably get there eventually. – Elias Mossholm Jun 15 '14 at 12:26
  • Maybe I should clarify the title. To me "reverse text direction" is [what Leonardo da Vinci did in his scripts](https://upload.wikimedia.org/wikipedia/commons/2/22/Da_Vinci_Vitruve_Luc_Viatour.jpg) but I realize that this is not how most discussions on RTL and LTR implementations seem to understand the concept. (EDIT: Done!) – Elias Mossholm Jun 15 '14 at 12:35
  • Final note: if it were me, I would want to reverse the words on a line, not the characters, assuming that the Farsi spoken word order is similar to English and that the translation follows this. I have this problem in German, where a word-by-word translation is needed: this becomes terrible English, but makes the German comprehensible when there is a lot of unknown vocabulary (and it helps appreciation of the poetry). – AFH Jun 15 '14 at 16:45
  • That might make sense for _translation_ but what I have on the second row is a _transcription_, i.e. the Farsi words written with Latin letters, in which case it’s pretty nice if the letters occur in the same order as in the original text. – Elias Mossholm Jun 16 '14 at 05:50
  • @EliasMossholm, writing the transcription right-to-left makes sense in that context and is used e.g. in the “The World’s Writing Systems” when original and transcription are shown together. You might consider additionally using monospace font for both. But mirroring would not be reasonable, since that would violate the identity of Latin letters (just as it would be wrong to write e.g. Hebrew letters as mirrored if you exceptionally write them left-to-right). – Jukka K. Korpela Jun 16 '14 at 06:34
0

If what the site you linked creates is good enough for your purposes (as you can see in the alphabet below it has limits), you might do it like this:

Create a script that does 52 find and replace operations on your text(s) replacing

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

with

ƸYXWVUTƧЯỌꟼOИM⅃ᐴႱIHᎮᖷƎᗡƆᙠAzyxwvuƚƨɿpqonmlʞႱiʜǫʇɘbɔdɒ

I have serious doubts though, that this is a better solution even than learning to read the reversed text. That's up to you i guess. Funny though how many unicode characters there are, that are mirrored latin letters.

TheUser1024
  • 2,901
  • 1
  • 17
  • 18
  • Thanks, I would probably just use the site above to reverse the text but it’s too far off to really be of help. The problem isn’t reading reversed text, the problem is that I want to read the Farsi text (right-to-left) simultaneously with the English transcription (left-to-right) on the row below, which is really hard when one starts at the right edge of the screen and the other starts at the left edge of the screen, my focus area isn’t big enough to do that ;-). – Elias Mossholm Jun 15 '14 at 12:38