Reputation: 1023
Setting TTextLayout.RightToLeft to True seems to be the same as setting TTextAlign.HorizontalAlign to TTextAlign.Trailing. So what's the point of RightToLeft? In fact they seem to reverse each other. If I set RightToLeft to True and HorizontalAlign to Trailing then the text is on the left again I was hoping that RightToLeft would cause the text to be written right to left as with Hebrew text, but this isn't the case. Does TTextLayout support Hebrew style right to left in any way?
Upvotes: 0
Views: 190
Reputation: 12292
Your observations are not correct.
Use this demo: https://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE6/Object%20Pascal/FireMonkey%20Desktop/TextLayoutDemo/. Add a line of text with an ending exclamation point such as "Hello World!". Then play with the settings. You'll see where the exclamation point goes.
Here is the result. The |
is used to show left and right margins
Align=Left, RightToleft=FALSE
|Hello World! |
Align=Right, RightToleft=FALSE
| Hello World!|
Align=Left, RightToleft=TRUE
| !Hello World|
Align=Right, RightToleft=TRUE
|!Hello World |
Now why does it works like that? I think it is related to languages written from right to left (Arab) or from left to right (English).
Upvotes: 3