nano-ui
Safe HaskellNone
LanguageGHC2024

NanoUI.Bidi

Description

Direction runs of a line of mixed left-to-right and right-to-left text, for hosts that shape one direction at a time.

This is the implicit part of the Unicode bidirectional algorithm (UAX #9) for a single line: the paragraph direction from the first strong character, European and Arabic numbers, neutrals between runs, and reordering by level. Explicit embeddings, overrides, isolates and bracket pairs are not handled; text using them lays out as if they were absent.

Synopsis

Documentation

data BidiRun Source #

Characters runStart up to runEnd (exclusive) shaped in one direction.

Constructors

BidiRun 

Fields

Instances

Instances details
Eq BidiRun Source # 
Instance details

Defined in NanoUI.Bidi

Methods

(==) :: BidiRun -> BidiRun -> Bool #

(/=) :: BidiRun -> BidiRun -> Bool #

Show BidiRun Source # 
Instance details

Defined in NanoUI.Bidi

bidiRuns :: Text -> [BidiRun] Source #

The runs of a line in visual order, left to right.

needsBidi :: Text -> Bool Source #

Whether a line has characters that can flow right to left. A line without them is one left-to-right run.