Main Page   Class Hierarchy   Compound List   File List   Header Files   Sources   Compound Members   File Members  

ushape.h File Reference


Defines

#define U_SHAPE_LENGTH_GROW_SHRINK
Memory option: allow the result to have a different length than the source.

#define U_SHAPE_LENGTH_FIXED_SPACES_NEAR
Memory option: the result must have the same length as the source. More...

#define U_SHAPE_LENGTH_FIXED_SPACES_AT_END
Memory option: the result must have the same length as the source. More...

#define U_SHAPE_LENGTH_RESERVED
Not a valid option value.

#define U_SHAPE_LENGTH_MASK
Bit mask for memory options.

#define U_SHAPE_TEXT_DIRECTION_LOGICAL
Direction indicator: the source is in logical (keyboard) order.

#define U_SHAPE_TEXT_DIRECTION_VISUAL_LTR
Direction indicator: the source is in visual LTR order, the leftmost displayed character stored first.

#define U_SHAPE_TEXT_DIRECTION_MASK
Bit mask for direction indicators.

#define U_SHAPE_LETTERS_NOOP
Letter shaping option: do not perform letter shaping.

#define U_SHAPE_LETTERS_SHAPE
Letter shaping option: replace abstract letter characters by "shaped" ones.

#define U_SHAPE_LETTERS_UNSHAPE
Letter shaping option: replace "shaped" letter characters by abstract ones.

#define U_SHAPE_LETTERS_RESERVED
Not a valid option value.

#define U_SHAPE_LETTERS_MASK
Bit mask for letter shaping options.

#define U_SHAPE_DIGITS_NOOP
Digit shaping option: do not perform digit shaping.

#define U_SHAPE_DIGITS_EN2AN
Digit shaping option: Replace European digits (U+0030...) by Arabic-Indic digits.

#define U_SHAPE_DIGITS_AN2EN
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...).

#define U_SHAPE_DIGITS_ALEN2AN_INIT_LR
Digit shaping option: Replace European digits (U+0030...) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (u_charDirection() result U_RIGHT_TO_LEFT_ARABIC [AL]).
The direction of "preceding" depends on the direction indicator option.
More...


#define U_SHAPE_DIGITS_ALEN2AN_INIT_AL
Digit shaping option: Replace European digits (U+0030...) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (u_charDirection() result U_RIGHT_TO_LEFT_ARABIC [AL]).
The direction of "preceding" depends on the direction indicator option.
More...


#define U_SHAPE_DIGITS_RESERVED
Not a valid option value.

#define U_SHAPE_DIGITS_MASK
Bit mask for digit shaping options.

#define U_SHAPE_DIGIT_TYPE_AN
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).

#define U_SHAPE_DIGIT_TYPE_AN_EXTENDED
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).

#define U_SHAPE_DIGIT_TYPE_RESERVED
Not a valid option value.

#define U_SHAPE_DIGIT_TYPE_MASK
Bit mask for digit type options.


Functions

U_CAPI int32_t U_EXPORT2 u_shapeArabic (const UChar *source, int32_t sourceLength, UChar *dest, int32_t destSize, uint32_t options, UErrorCode *pErrorCode)
Shape Arabic text on a character basis. More...


Define Documentation

#define U_SHAPE_LENGTH_GROW_SHRINK ()

Memory option: allow the result to have a different length than the source.

Definition at line 106 of file ushape.h.

#define U_SHAPE_LENGTH_FIXED_SPACES_NEAR ()

Memory option: the result must have the same length as the source.

If more room is necessary, then try to consume spaces next to modified characters.

Definition at line 112 of file ushape.h.

#define U_SHAPE_LENGTH_FIXED_SPACES_AT_END ()

Memory option: the result must have the same length as the source.

If more room is necessary, then try to consume spaces at the end of the text.

Definition at line 118 of file ushape.h.

#define U_SHAPE_LENGTH_RESERVED ()

Not a valid option value.

Definition at line 121 of file ushape.h.

#define U_SHAPE_LENGTH_MASK ()

Bit mask for memory options.

Definition at line 124 of file ushape.h.

#define U_SHAPE_TEXT_DIRECTION_LOGICAL ()

Direction indicator: the source is in logical (keyboard) order.

Definition at line 128 of file ushape.h.

#define U_SHAPE_TEXT_DIRECTION_VISUAL_LTR ()

Direction indicator: the source is in visual LTR order, the leftmost displayed character stored first.

Definition at line 134 of file ushape.h.

#define U_SHAPE_TEXT_DIRECTION_MASK ()

Bit mask for direction indicators.

Definition at line 137 of file ushape.h.

#define U_SHAPE_LETTERS_NOOP ()

Letter shaping option: do not perform letter shaping.

Definition at line 141 of file ushape.h.

#define U_SHAPE_LETTERS_SHAPE ()

Letter shaping option: replace abstract letter characters by "shaped" ones.

Definition at line 144 of file ushape.h.

#define U_SHAPE_LETTERS_UNSHAPE ()

Letter shaping option: replace "shaped" letter characters by abstract ones.

Definition at line 147 of file ushape.h.

#define U_SHAPE_LETTERS_RESERVED ()

Not a valid option value.

Definition at line 150 of file ushape.h.

#define U_SHAPE_LETTERS_MASK ()

Bit mask for letter shaping options.

Definition at line 153 of file ushape.h.

#define U_SHAPE_DIGITS_NOOP ()

Digit shaping option: do not perform digit shaping.

Definition at line 157 of file ushape.h.

#define U_SHAPE_DIGITS_EN2AN ()

Digit shaping option: Replace European digits (U+0030...) by Arabic-Indic digits.

Definition at line 163 of file ushape.h.

#define U_SHAPE_DIGITS_AN2EN ()

Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...).

Definition at line 169 of file ushape.h.

#define U_SHAPE_DIGITS_ALEN2AN_INIT_LR ()

Digit shaping option: Replace European digits (U+0030...) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (u_charDirection() result U_RIGHT_TO_LEFT_ARABIC [AL]).
The direction of "preceding" depends on the direction indicator option.

For the first characters, the preceding strongly directional character (initial state) is assumed to be not an Arabic letter (it is U_LEFT_TO_RIGHT [L] or U_RIGHT_TO_LEFT [R]).

Definition at line 181 of file ushape.h.

#define U_SHAPE_DIGITS_ALEN2AN_INIT_AL ()

Digit shaping option: Replace European digits (U+0030...) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (u_charDirection() result U_RIGHT_TO_LEFT_ARABIC [AL]).
The direction of "preceding" depends on the direction indicator option.

For the first characters, the preceding strongly directional character (initial state) is assumed to be an Arabic letter.

Definition at line 192 of file ushape.h.

#define U_SHAPE_DIGITS_RESERVED ()

Not a valid option value.

Definition at line 195 of file ushape.h.

#define U_SHAPE_DIGITS_MASK ()

Bit mask for digit shaping options.

Definition at line 198 of file ushape.h.

#define U_SHAPE_DIGIT_TYPE_AN ()

Digit type option: Use Arabic-Indic digits (U+0660...U+0669).

Definition at line 202 of file ushape.h.

#define U_SHAPE_DIGIT_TYPE_AN_EXTENDED ()

Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).

Definition at line 205 of file ushape.h.

#define U_SHAPE_DIGIT_TYPE_RESERVED ()

Not a valid option value.

Definition at line 208 of file ushape.h.

#define U_SHAPE_DIGIT_TYPE_MASK ()

Bit mask for digit type options.

Definition at line 211 of file ushape.h.


Function Documentation

U_CAPI int32_t U_EXPORT2 u_shapeArabic (const UChar * source, int32_t sourceLength, UChar * dest, int32_t destSize, uint32_t options, UErrorCode * pErrorCode)

Shape Arabic text on a character basis.

This function performs basic operations for "shaping" Arabic text. It is most useful for use with legacy data formats and legacy display technology (simple terminals). All operations are performed on Unicode characters.

Text-based shaping means that some character code points in the text are replaced by others depending on the context. It transforms one kind of text into another. In comparison, modern displays for Arabic text select appropriate, context-dependent font glyphs for each text element, which means that they transform text into a glyph vector.

Text transformations are necessary when modern display technology is not available or when text needs to be transformed to or from legacy formats that use "shaped" characters. Since the Arabic script is cursive, connecting adjacent letters to each other, computers select images for each letter based on the surrounding letters. This usually results in four images per Arabic letter: initial, middle, final, and isolated forms. In Unicode, on the other hand, letters are normally stored abstract, and a display system is expected to select the necessary glyphs. (This makes searching and other text processing easier because the same letter has only one code.) It is possible to mimic this with text transformations because there are characters in Unicode that are rendered as letters with a specific shape (or cursive connectivity). They were included for interoperability with legacy systems and codepages, and for unsophisticated display systems.

A second kind of text transformations is supported for Arabic digits: For compatibility with legacy codepages that only include European digits, it is possible to replace one set of digits by another, changing the character code points. These operations can be performed for either Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).

Note: Right now, the letter shaping is not yet implemented here. Only digit shaping is currently supported.

Some replacements may result in more or fewer characters (code points). By default, this means that the destination buffer may receive text with a length different from the source length. Some legacy systems rely on the length of the text to be constant. They expect extra spaces to be added or consumed either next to the affected character or at the end of the text.

For details about the available operations, see the description of the U_SHAPE_... options.

Parameters:
source   The input text.

Parameters:
sourceLength   The number of UChars in source.

Parameters:
dest   The destination buffer that will receive the results of the requested operations. It may be NULL only if destSize is 0. The source and destination must not overlap.

Parameters:
destSize   The size (capacity) of the destination buffer in UChars. If destSize is 0, then no output is produced, but the necessary buffer size is returned ("preflighting").

Parameters:
options   This is a 32-bit set of flags that specify the operations that are performed on the input text. If no error occurs, then the result will always be written to the destination buffer.

Parameters:
pErrorCode   must be a valid pointer to an error code value, which must not indicate a failure before the function call.

Returns:
The number of UChars written to the destination buffer. If an error occured, then no output was written, or it may be incomplete. If U_BUFFER_OVERFLOW_ERROR is set, then the return value indicates the necessary destination buffer size.

Generated at Wed Aug 16 16:05:31 2000 for ICU1.6 by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999