mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
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:
+2
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user