Hi,
I don't write nor read RTL languages, I wrote a function to detect if the text starts with a RTL char
function checkRtl (S : string; Exceptions : String = '' ) : TTextAlign;
var carray : array of WideChar;
i : int64;
ws : String;
begin
for I := 0 to 9 do
S:=StringReplace(S,i.ToString,'',[rfReplaceAll]);
// supprime autres caractères spéciaux
S:=StringReplace(S,'(','',[rfReplaceAll]);
S:=StringReplace(S,')','',[rfReplaceAll]);
S:=StringReplace(S,'"','',[rfReplaceAll]);
S:=StringReplace(S,'''','',[rfReplaceAll]);
S:=StringReplace(S,'-','',[rfReplaceAll]);
if not E.IsEmpty then
begin
for I := 1 to Length(Exceptions) do
S:=StringReplace(S,Exceptions[i],'',[rfReplaceAll]);
end;
S:=Trim(S);
// arabic + hebrew
SetLength(carray,$6ff-$590);
for I := $590 to $6ff do carray[i-$590]:=Char(I);
// there are some farsi char to be added
result:=TTextAlign.Trailing;
if S.IsEmpty then exit;
if inOpArray(S[1],carray) then result:=TTextAlign.Leading;
end;
And, with Nabil's Help I test my ideas in a grid.
You can find (french) discussion here and my tutorial https://serge-girard.developpez.com/tutoriels/Delphi/Livebindings/Grilles/#LVII-C-1
I did not test for TEdit and TLabel though but my guess it is possible