Closed dhardy closed 4 years ago
The promised screenshot:
Sample text is taken from r12a. There are some notable issues here, which are left for now:
Run
struct, but would require further changes to how unsplittable-run-length is calculated in the line-wrapping algorithm.unicode-bidi
reports the whole as having a single run-level: Level(2), text[243..248]: '10-12', breaks=[]
. Results are identical with the unic-bidi
fork. This may be due to https://github.com/servo/unicode-bidi/issues/8 .Frankly, I've already put more work into supporting BIDI than I have justification for, so likely won't work further on this (besides navigation). The rationale was to test that the crate's architecture was compatible with BIDI processing, to which the answer seems to be just about. From reading Unicode TR#9, it almost seems like shaping must happen twice: first to measure the widths of unsplittable text segments, and second to draw glyphs after rearranging characters, however initial shaping on RTL text must already use the correct glyph order and any differences between initial and final shaping could generate incorrect line length, so practically speaking this would appear unnecessary.
To conclude the above paragraph: this implementation uses a single shaping pass. There may be limitations, but is seems good enough (at least for now).
This adds support for:
As such, it can now display simple bidirectional text.
Also, text navigation will need many fixes. That will be another PR.