font/opentype,text,widget: use clip.Op for text shapes, not a macro

This change avoids a macro wrapping every text shape, and prepares text
shaping for scoped clip operations.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-10-02 18:11:31 +02:00
parent cd5a78f3d8
commit c1298cd755
7 changed files with 26 additions and 29 deletions
+2 -3
View File
@@ -5,9 +5,8 @@ package text
import (
"io"
"gioui.org/op/clip"
"golang.org/x/image/math/fixed"
"gioui.org/op"
)
// A Line contains the measurements of a line of text.
@@ -49,7 +48,7 @@ type Font struct {
// methods must be safe for concurrent use.
type Face interface {
Layout(ppem fixed.Int26_6, maxWidth int, txt io.Reader) ([]Line, error)
Shape(ppem fixed.Int26_6, str Layout) op.CallOp
Shape(ppem fixed.Int26_6, str Layout) clip.Op
}
// Typeface identifies a particular typeface design. The empty