kas-gui / kas-text

Rich text processing
Apache License 2.0
58 stars 2 forks source link

Re-implement basic breaking and shaping #5

Closed dhardy closed 3 years ago

dhardy commented 3 years ago

Implements basic line-breaking and text shaping (take 2). This should allow easier inclusion of BIDI processing and proper shaping.

Also implements position look-up (now much simpler) and correct highlighting of multiple lines (two options).

Performance is just slow enough to be perceptible (unlike Qt). I haven't investigated, but I suspect the issue is drawing (which could benefit from caching the output of positioned_glyphs). But it's too soon to worry about optimisation, and I don't think there's any issue with scaling provided we add a variant of positioned_glyphs with view-bounds later.

Feature-wise, this already has a couple of advantages over glyph_brush_layout: