linebender / parley

Rich text layout library
Apache License 2.0
229 stars 28 forks source link

Add optional AccessKit integration for text layout and `PlainEditor` #166

Closed mwcampbell closed 2 weeks ago

mwcampbell commented 2 weeks ago

This is an optional feature in Parley. vello_editor demonstrates how to use it.

mwcampbell commented 2 weeks ago

I'm aware that this may soon be invalidated by @dfrg's planned change from character indices to gap indices. But I thought I should still get this PR open first, since I have something that more or less works.

The part I'm least sure about is how to expose geometry, particularly the bounding rectangles for the runs. I'm not sure if I'm doing the right thing for layouts where the dominant direction is RTL. But then, I'm also not sure if vello_editor's code for rendering the selection and cursor works in that case.

Another thing I need confirmation on: Does Line::runs always iterate over runs in textual order?

mwcampbell commented 2 weeks ago

I've now addressed all of @DJMcNab's comments. Should I wait for anyone else in particular to review this before merging?

DJMcNab commented 2 weeks ago

It should probably get a once-over from @dfrg, but I think this can land even if we don't hear from him today.

mwcampbell commented 2 weeks ago

I got two approvals, but I'm still inclined to wait and see if @dfrg, who seemingly has the most expertise about text and parley specifically, can look at this soon. But if anyone else thinks this should be landed immediately, I can do that.

dfrg commented 2 weeks ago

The code generally LGTM. I think there’s room for improvement if we adjust some of the layout data structures to be more amenable to accesskit integration but that’s something to keep in mind for future work so I’m happy to land this in current form. Thanks!