Printing bidirectional data

The printing of bidirectional (bidi) data requires special handling due to the nature of the text. In most cases where data is stored in the order it is entered such as logical ordering scheme), the text must undergo a process of layout transformation. This process involves reordering so the characters that they are displayed in a readable sequence to the user. In cases where the data contains Arabic scripts, the process will include an additional step, shaping, in which the characters are converted into the correct glyphs according to their position within the text.

Bidi data can be printed in two main forms: either as an image or as text. Data in image format will generally not require any modification as it is stored in the exact way it should be printed. Where it is stored as text, the layout transformation process might need to be performed before it is sent to the printer, depending on whether there is a need for layout transformation or not based on the ordering scheme in which the data is stored. If the data is stored in a visual ordering scheme and shaped, this implies that layout transformation is required. If the data is stored in a logical ordering scheme, this implies that reordering and shaping is required. When required, the bidi print filter serves the main role of performing this layout transformation on the text before it is sent to the printer.