Bidirectional (BIDI) text results when texts of different direction orientation
appear together. For example, English text is read from left to right. Arabic
and Hebrew texts are read from right to left. If both English and Hebrew texts
appear on the same line, the text is bidirectional. For further information
about directional text and character shaping, including a list of available
publications, see the following web address:
http://www.opengroup.org
Write bidirectional text according to the following guidelines:
Bidirectional script is read from right to left and from top to bottom.
If the embedded text is contained in one line, the text is written from left to right and embedded in the bidirectional text. However, if the embedded text is split between two or more lines, the correct order must be maintained in the left-to-right portions to allow top-to-bottom reading.
For example, right-to-left text embedded in left-to-right text that is contained in one line is written as follows:
THERE IS txet lanoitceridib deddebme IN THIS SENTENCE.
Right-to-left text embedded in left-to-right text that is split between two lines is written as follows:
THERE IS senil owt neewteb tilps si taht txet lanoitceridib deddebme IN THIS SENTENCE.
Both texts maintain readability even though the embedded text is split.
Bidirectional text environments use the following data streams:
Cursor movement on a screen containing bidirectional text is as follows:
Visual | The cursor moves from its current position left or right to the next
character, or up or down to the next row. For example, if the cursor is located
at the end of the first left-to-right part of a mixed sentence:
THERE IS_txet lanoitceridib IN THIS SENTENCE. then, moving the cursor visually to the right causes it to move one character to the right, as follows: THERE IS txet lanoitceridib IN THIS SENTENCE.
The cursor moves without regard to the contents of the text. |
Logical | The cursor moves from its current position to the next or previous
character in the data stream. The character may be adjacent to the cursor's
position, elsewhere in the same line, or on another line on the screen. Logical
cursor movement requires scanning the data stream to find the next logical
character. For example, if the cursor is located at the end of the first left-to-right
part of a mixed sentence:
THERE IS_txet lanoitceridib IN THIS SENTENCE. then, moving the cursor logically to the next character causes the data stream to be scanned to find the next logical character. The cursor moves to the next logical part of the sentence, as follows: THERE IS txet lanoitceridib_IN THIS SENTENCE. The cursor moves according to content. |
Character shaping occurs when the shape of a character is dependent on its position in a line of text. In some languages, such as Arabic, characters have different shapes depending on their position in a string and on the surrounding characters.
The following characteristics determine character shaping in Arabic script:
Implement character shaping separately from other system components. However, character shaping should be accessible as a utility by other system components. The system may use character shaping in the following ways:
This method avoids the need to use character shaping every time these characters are displayed. This method is meant for static data such as menus and help. This method requires preprocessing for correct sorting, searching, or indexing of the characters.
The characters may need reshaping after processing for proper presentation.
This method allows for sorting, searching or indexing of the characters. However, the system must use character shaping every time the characters are displayed.
Base shapes are isolated shapes that were not generated by character shaping. Use base shapes during editing, searching for character strings, or other text operations. Use shaping only when the text is displayed or printed. If characters are stored in their shaped form, the system must deshape them before sorting, collating, searching, or indexing. Character shapes that are not shape-determined according to their position in a string are needed for specific character-handling applications, as well as for communication with different coding environments.
In general, contextual character shaping is the selection of the required shape of a character in a given font depending on its position in a word and its surrounding characters. The following shapes are possible:
Isolated | A character that is connected to neither a preceding nor succeeding character |
Final | A character that is connected to a preceding character but not with a succeeding character |
Initial | A character connected to a succeeding character but not with a preceding character |
Middle | A character connected to both a preceding and succeeding character |
A character may also have any of the following characteristics:
Acronyms, part numbers, and graphic characters do not need contextual character shaping. To properly enter these characters, turn off the contextual character shaping and use a specific keyboard interface for exact selection of the desired shape. Tag these characters by field, line, or control character for later presentation.