linebender / parley

Rich text layout library
Apache License 2.0
164 stars 18 forks source link

Support unicode aware line breaking #9

Open dfrg opened 3 years ago

dfrg commented 3 years ago

Add support for Unicode aware line breaking according to UAX #14.

chris-morgan commented 2 years ago

Scope question: would this include supporting (regardless of whether they’re included in this crate itself or not) diverse fitting algorithms, e.g. Knuth-Plass instead of the ubiquitous greedy?

(Knuth-Plass isn’t suitable for text editing because you don’t want your paragraph reflowing all the time as you type, but for rendering existing text it’s generally excellent, and I’m working on a project where I want something like that and am deciding whether to work with lower-level components directly or help build a more powerful thing like this.)

dfrg commented 2 years ago

To make the crate generally useful and composable, my goal is to expose as much of the internal layout pipeline as possible including line breaking. I'm not quite sure what the API for that looks like yet, but I'll have a much better idea at the end of next week.

I'm also not opposed to including an implementation of Knuth-Plass at some point in the future.