Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: display-order bidi navigation #36

Open
dhardy opened this issue Nov 10, 2020 · 0 comments
Open

Feature: display-order bidi navigation #36

dhardy opened this issue Nov 10, 2020 · 0 comments

Comments

@dhardy
Copy link
Contributor

dhardy commented Nov 10, 2020

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant