Bidi.GetVisualIndex(Int32) Method

Definition

Get the visual position from a logical text position.

[Android.Runtime.Register("getVisualIndex", "(I)I", "GetGetVisualIndex_IHandler", ApiSince=29)]
public virtual int GetVisualIndex (int logicalIndex);
[<Android.Runtime.Register("getVisualIndex", "(I)I", "GetGetVisualIndex_IHandler", ApiSince=29)>]
abstract member GetVisualIndex : int -> int
override this.GetVisualIndex : int -> int

Parameters

logicalIndex
Int32

is the index of a character in the text.

Returns

The visual position of this character.

Attributes

Remarks

Get the visual position from a logical text position. If such a mapping is used many times on the same Bidi object, then calling getLogicalMap() is more efficient.

The value returned may be MAP_NOWHERE if there is no visual position because the corresponding text character is a Bidi control removed from output by the option OPTION_REMOVE_CONTROLS.

When the visual output is altered by using options of writeReordered() such as INSERT_LRM_FOR_NUMERIC, KEEP_BASE_COMBINING, OUTPUT_REVERSE, REMOVE_BIDI_CONTROLS, the visual position returned may not be correct. It is advised to use, when possible, reordering options such as #OPTION_INSERT_MARKS and #OPTION_REMOVE_CONTROLS.

Note that in right-to-left runs, this mapping places second surrogates before first ones (which is generally a bad idea) and combining characters before base characters. Use of {@link #writeReordered}, optionally with the {@link #KEEP_BASE_COMBINING} option can be considered instead of using the mapping, in order to avoid these issues.

Java documentation for android.icu.text.Bidi.getVisualIndex(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to