bidi library

Implementation of the Bidi algorithm, as described in http://www.unicode.org/reports/tr9/tr9-17.html.

Converts logical strings to their equivalent visual representation. Persian, Hebrew and Arabic languages (and any other RTL language) are supported.

Classes

BidiString
Bidi String.
Normalization
Contains a set of functions for bidi text normalization (decomposition and composition).
Paragraph
Represents a paragraph in text.

Enums

CharacterCategory
Unicode character categories.
CharacterType
Types of BiDi characters (Table 4 in the Unicode BiDi algorithm).
DecompositionType
The type of Unicode character decomposition.
DirectionOverride
Used to determine current letter direction (Table 2 in the Unicode BiDi algorithm).
LetterForm
The four different available letter presentation forms.
ShapeJoiningType
Letter joining types of Persian letters.

Constants

characterCategories → const Map<int, CharacterCategory>
Character Categories.
characterTypes → const Map<int, CharacterType>
Character types.
decompositionTypes → const Map<int, DecompositionType>
Decomposition Types.

Functions

compose(String sequence) int
Composes a sequence.
getCharacterType(int character) CharacterType
Returns the BiDi type for a given character.
getDecompositionMapping(int character) List<int>?
Gets the Unicode decomposition mapping.
getDecompositionType(int character) DecompositionType?
Gets the Unicode decomposition type.
getShapeJoiningType(int character) ShapeJoiningType
Get joining types of Persian letters.
logicalToVisual(String logicalString) List<int>
Implementation of the BIDI algorithm, as described in http://www.unicode.org/reports/tr9/tr9-17.html logicalString is the original logical-ordered string. Returns the visual representation of the string.
logicalToVisual2(String logicalString, List<int> indexes, List<int> lengths) String
Implementation of the BIDI algorithm, as described in http://www.unicode.org/reports/tr9/tr9-17.html logicalString is the original logical-ordered string. indexes Implies where the original characters are. lengths Implies how many characters each original character occupies. Returns the visual representation of the string.
splitStringToParagraphs(String logicalString) List<Paragraph>
Split the text into separate paragraphs.