OS/2 provides a set of functions to manage the conversion of bidirectional text between different formats. The text is assumed to be in a form/representation that is described by a set of input values and is converted to another form described by a set of output values.
In order to perform a text conversion, the caller must first call LayoutCreateObject to create a layout object. The layout object is automatically associated with a set of default values, known as layout values, that depend on the locale used to create it.
Currently, the following locale is supported:
Using the handle to the layout object created, the caller can query the current values using LayoutQueryValues and set them, using LayoutSetValues, to the values required for the text transformation.
The section Layout Values describes the standard set of layout values that are supported. It also describes which layout values may be changed after creation of the layout object.
The actual text transformation is done by the LayoutTransformText function, which converts its input buffer according to the values associated with the layout object. LayoutTransformText can also optionally provide some additional information about the transformation performed, such as mappings of the input buffer to the output buffer.
LayoutEditShape is a more specialized text conversion function that allows an application to do Arabic character shape editing in and around a specific location in a buffer.
When an application has finished its text conversions, it can release the resources used by the layout object using LayoutDestroyObject.