It is still a lot of work, and a lot of extra to read...
copy and paste it together, find the correct units to use (assuming you use the same (drawtext from LclIntf?)
Most none RTL users will not bother, even though they could test.
--- anyway I did test, on win vista 32 bit. (with and without manifest)
Someone still needs to test xp
procedure TForm1.Button1Click(Sender: TObject);
var s: String;
R: TRect;
begin
MessageDlg('% ,خطأ نسبي', '% ,خطأ نسبي', mtInformation, mbYesNo, 0);
s:='% ,خطأ نسبي';
r.Top := 40;
r.Left := 30;
r.Bottom := 88;
r.Right := 222;
DrawText(Form1.Canvas.Handle, PChar(s), Length(s), R, DT_WORDBREAK);
end;
Note, the editor will display the messagedialog line in an unexpected way. The ', ' is between 2 RTL sections. The chars are have a weak leading, and will be taken an RTL too, meaning they read in the wrong direction.
However the first '% bound to the LTR text before so the % stays at the beginning.
Test results:
The words are displayed correct, but the % is at the left side not the end. I guess this is because my system is LTR.
For drawtext I can do:
DrawText(Form1.Canvas.Handle, PChar(s), Length(s), R, DT_WORDBREAK + DT_RTLREADING);
And I get the correct words, and the % is on the right side