go.*,text,widget{,/material}: enable configurable line wrapping within words

This commit enables consumers of the text shaper to select a policy for how
line breaking candidates will be chosen. The new default policy can break lines
within "words" (UAX#14 segments) when words do not fit by themselves on a line.
This ensures that text does not horizontally overflow its bounding box unless
the available width is insufficient to display a single UAX#29 grapheme cluster.

Fixes: https://todo.sr.ht/~eliasnaur/gio/467
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2023-06-07 16:56:32 -04:00
committed by Elias Naur
parent a252394356
commit c6e4eecf21
12 changed files with 92 additions and 16 deletions
+1
View File
@@ -409,6 +409,7 @@ func TestEditorRTL(t *testing.T) {
func TestEditorLigature(t *testing.T) {
e := new(Editor)
e.WrapPolicy = text.WrapWords
gtx := layout.Context{
Ops: new(op.Ops),
Constraints: layout.Exact(image.Pt(100, 100)),