Table of Contents

Enum TextDirection

Namespace
Egami.Fonts.Unicode
Assembly
Egami.Fonts.dll

The direction of a paragraph or a run of text.

public enum TextDirection

Fields

Auto = 0

The paragraph direction follows the first strong character (UAX #9 rules P2 and P3), left to right when there is none.

LeftToRight = 1

Left to right.

RightToLeft = 2

Right to left.

TopToBottom = 3

Top to bottom, for vertical runs; bidi treats it as left to right.

Examples

// A Hebrew word inside English text: three runs, the middle one drawn right to left.
string text = "abc \u05D0\u05D1\u05D2 def";
using BidiResult result = Bidi.Resolve(text, TextDirection.Auto);
int paragraph = result.ParagraphLevel;           // 0: the first strong character is Latin
foreach (BidiRun run in result.Reorder(0, result.Length))
{
    Console.WriteLine($"{run.Start}+{run.Length} {(run.IsRightToLeft ? "right to left" : "left to right")}");
}