This function performs basic operations for "shaping" Arabic text. It is most 34 * useful for use with legacy data formats and legacy display technology 35 * (simple terminals). All operations are performed on Unicode characters.
Text-based shaping means that some character code points in the text are 38 * replaced by others depending on the context. It transforms one kind of text 39 * into another. In comparison, modern displays for Arabic text select 40 * appropriate, context-dependent font glyphs for each text element, which means 41 * that they transform text into a glyph vector.
Text transformations are necessary when modern display technology is not 44 * available or when text needs to be transformed to or from legacy formats that 45 * use "shaped" characters. Since the Arabic script is cursive, connecting 46 * adjacent letters to each other, computers select images for each letter based 47 * on the surrounding letters. This usually results in four images per Arabic 48 * letter: initial, middle, final, and isolated forms. In Unicode, on the other 49 * hand, letters are normally stored abstract, and a display system is expected 50 * to select the necessary glyphs. (This makes searching and other text 51 * processing easier because the same letter has only one code.) It is possible 52 * to mimic this with text transformations because there are characters in 53 * Unicode that are rendered as letters with a specific shape 54 * (or cursive connectivity). They were included for interoperability with 55 * legacy systems and codepages, and for unsophisticated display systems.
A second kind of text transformations is supported for Arabic digits: 58 * For compatibility with legacy codepages that only include European digits, 59 * it is possible to replace one set of digits by another, changing the 60 * character code points. These operations can be performed for either 61 * Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic 62 * digits (U+06f0...U+06f9).
Some replacements may result in more or fewer characters (code points). 65 * By default, this means that the destination buffer may receive text with a 66 * length different from the source length. Some legacy systems rely on the 67 * length of the text to be constant. They expect extra spaces to be added 68 * or consumed either next to the affected character or at the end of the 69 * text.
For details about the available operations, see the description of the 72 * U_SHAPE_... options.
U_SHAPE_...
source
NULL
destSize
U_BUFFER_OVERFLOW_ERROR
u_charDirection()
U_RIGHT_TO_LEFT_ARABIC
U_LEFT_TO_RIGHT
U_RIGHT_TO_LEFT