Graphics.TextDirection

From Xojo Documentation

Method

Graphics.TextDirection(text As String) As TextDirections

New in 2019r2

Supported for all project types and targets.

Returns an Enumeration that indicates the direction in which the text is written.

Notes

This is useful for non-Roman systems, especially Middle-Eastern languages. If you pass an empty string, it returns the system default string direction. If this function is not supported on the user's system, the Graphics.TextDirections value will be Unknown.

Sample Code

This example gets the string direction.

If g.TextDirection("Hello world") = Graphics.TextDirections.RightToLeft then
MessageBox("We are on a right to left system.")
End If