Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE void U_EXPORT2 ubidi_setInverse ( UBiDi pBiDi,
UBool  isInverse 
)

Modify the operation of the Bidi algorithm such that it approximates an "inverse Bidi" algorithm. This function must be called before ubidi_setPara().

The normal operation of the Bidi algorithm as described in the Unicode Technical Report is to take text stored in logical (keyboard, typing) order and to determine the reordering of it for visual rendering. Some legacy systems store text in visual order, and for operations with standard, Unicode-based algorithms, the text needs to be transformed to logical order. This is effectively the inverse algorithm of the described Bidi algorithm. Note that there is no standard algorithm for this "inverse Bidi" and that the current implementation provides only an approximation of "inverse Bidi".

With isInverse set to TRUE, this function changes the behavior of some of the subsequent functions in a way that they can be used for the inverse Bidi algorithm. Specifically, runs of text with numeric characters will be treated in a special way and may need to be surrounded with LRM characters when they are written in reordered sequence.

Output runs should be retrieved using ubidi_getVisualRun(). Since the actual input for "inverse Bidi" is visually ordered text and ubidi_getVisualRun() gets the reordered runs, these are actually the runs of the logically ordered output.

Calling this function with argument isInverse set to TRUE is equivalent to calling ubidi_setReorderingMode with argument reorderingMode set to UBIDI_REORDER_INVERSE_NUMBERS_AS_L.
Calling this function with argument isInverse set to FALSE is equivalent to calling ubidi_setReorderingMode with argument reorderingMode set to UBIDI_REORDER_DEFAULT.

Parameters:
pBiDi is a UBiDi object.
isInverse specifies "forward" or "inverse" Bidi operation.
See also:
ubidi_setPara

ubidi_writeReordered

ubidi_setReorderingMode ICU 2.0

Definition at line 263 of file ubidi.c.

References NULL, UBIDI_REORDER_DEFAULT, and UBIDI_REORDER_INVERSE_NUMBERS_AS_L.

                                                {
    if(pBiDi!=NULL) {
        pBiDi->isInverse=isInverse;
        pBiDi->reorderingMode = isInverse ? UBIDI_REORDER_INVERSE_NUMBERS_AS_L
                                          : UBIDI_REORDER_DEFAULT;
    }
}


Generated by  Doxygen 1.6.0   Back to index