Conversions of Bidirectional Text Data

Bidirectional applications use bidirectional text. The bidirectional text is described by bidirectional attributes. Since applications use different sets of bidirectional attributes (and thus, different representations of bidirectional text), it is necessary to convert this text among representation forms. The most common case is when an application converts the text from the internal (storage) representation to the external (presentation) form.

OS/2 provides a set of APIs to manage the conversion of bidirectional text between different formats. The text is assumed to be in a form/layout 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 locales are 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 actual text transformation is done by the LayoutTransformText API, 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 API 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 should release the resources used by the layout object using LayoutDestroyObject.

See more on layout values and programming in the reference section.


[Back: Numerals]
[Next: PM Support for Bidirectional Attributes]