Skip to content

Feature: display-order bidi navigation #36

@dhardy

Description

@dhardy

Currently our API recommends using an external library such as unicode-segmentation in order to navigate "left/right" by one glyph. This results in logical-order text navigation (or optionally, reversed logical order navigation for RTL lines).

We should add support for display-order navigation, which is much easier within this library than externally.

We might try using glyphs within glyph-runs (TextDisplay::runs[run].glyphs). Caveat: the runs on a line are not in display order. We could thus compare glyphs using Glyph::position or we could store runs in display order (simply remove the sort_by_key line within wrap_lines.rs, but then we have to fix a couple of algorithms currently expecting logical-order runs).

We also have to consider the position at the end of each run, which may or may not coincide with the start of another run, and if it does may or may not coincide with the text index of that position.

(I consider this low priority. Contributions welcome.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions