U_CAPI UBiDiDirection U_EXPORT2 ubidi_getVisualRun (UBiDi *pBiDi, UTextOffset runIndex, UTextOffset *pLogicalStart, UTextOffset *pLength) Get one run's logical start, length, and directionality, which can be 0 for LTR or 1 for RTL
Get one run's logical start, length, and directionality, which can be 0 for LTR or 1 for RTL. In an RTL run, the character at the logical start is visually on the right of the displayed run. The length is the number of characters in the run.
ubidi_countRuns()should be called before the runs are retrieved.
UBIDI_LTR==0 or UBIDI_RTL==1,
never UBIDI_MIXED.
UBiDi object.
[0..ubidi_countRuns(pBiDi)-1].
NULL if this index is not needed.
NULL if this is not needed.
UTextOffset i, count=ubidi_countRuns(pBiDi),
logicalStart, visualIndex=0, length;
for(i=0; i<count; ++i) {
if(UBIDI_LTR==ubidi_getVisualRun(pBiDi, i, &logicalStart, &length)) {
do { show_char(text[logicalStart++], visualIndex++);
} while(--length>0);
} else {
logicalStart+=length; do { show_char(text[--logicalStart], visualIndex++);
} while(--length>0);
}
}
Note that in right-to-left runs, code like this places
modifier letters before base characters and second surrogates
before first ones.alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de