/// <summary> /// Get the visual position from a logical text position. /// </summary> /// <param name="logicalIndex">The index of a character in the tex</param> /// <returns>The visual position of this character.</returns> public int GetVisualIndex(int logicalIndex) { var ret = NativeMethods.ubidi_getVisualIndex(_biDi, logicalIndex, out var errorCode); ExceptionFromErrorCode.ThrowIfError(errorCode, "Get visual index failed! " + errorCode); return(ret); }