8

How can show any string in right to left languages such as Persian or Arabic in Android or iOS with FireMonkey?

I Use Embarcadero Rad Studio XE6 (Delphi) and when I put a TLabel or TEdit and set its text to "سلام" (Hello in Persian) everything is OK in Windows and Mac but in Mobile platform that is wrong display, in Android shows "م ا ل س" and in iOS does not show anything but space.

The problem still exists in Delphi XE7.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Amin
  • 1,242
  • 2
  • 12
  • 25
  • 1
    I think your best option is to read [Delphi XE5 right to left languages don't appear as they should in android](http://stackoverflow.com/q/18883356/576719). – LU RD Sep 20 '14 at 20:04
  • 1
    Follow the link to the QC report, which has a link to a native library, [D.P.F Delphi Android Native Components](http://sourceforge.net/projects/dpfdelphiandroid/). @Amin claims this works for RTL in Android and IOS. – LU RD Sep 20 '14 at 20:15
  • 1
    Note that the problem is fixed in the Delphi XE8 beta. – Johan Apr 04 '15 at 20:14
  • @Johan it is too late, I migrate to Cordova :) – Amin May 06 '15 at 07:47
  • @Johan do they fixed it in update 1 of xe8 ? – Vlark.Lopin Nov 26 '16 at 03:42

4 Answers4

2

As per LURD's suggestions.
Download and use D.P.F Delphi Android Native Components and/or D.P.F Delphi iOS Native Components.
That will fix the problem in XE7 and prior.
According to the documentation with the Delphi XE8 beta the problem is fixed there as well.

Johan
  • 74,508
  • 24
  • 191
  • 319
  • 1
    There is no XE8 support for BiDi RTL and there is no sign of this in any roadmaps published so far. That XE8 would support BiDi mode was an april fool's message, perhaps originated from here: https://forums.embarcadero.com/thread.jspa?threadID=114299 – LU RD Nov 26 '16 at 22:19
  • Johan Can you please edit your answer to take out the wrong statement at the end, FMX is still not supporting rtl. – Nasreddine Galfout Aug 15 '20 at 04:49
2

Firemonkey does not natively support Right-To-Left text rendering. You will have to use a third-party library for this. One of the best options is Skia4Delphi: https://github.com/skia4delphi/skia4delphi

In the library demo itself there is an example using Right-To-Left. Look:

enter image description here

vfbb
  • 611
  • 7
  • 15
1

In Delphi version XE Don't Support BiDi.

If You want use D.P.F Delphi Android Native Components.

You should in Forms use DPFlayuot Next Align in Client

asdfavfwer
  • 11
  • 4
0

Delphi XE don't support Bidi RTL yet(Delphi 10.3 Rio). But you can download FMX RTL components. It support Persian, Arabic and Hebrew for Fire Monkey framework.