mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
text: add io.Reader Layout method to Shaper
use them for Editor, which is no longer required to construct a string for laying out its content. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-1
@@ -3,6 +3,8 @@
|
||||
package text
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"gioui.org/op"
|
||||
"gioui.org/unit"
|
||||
"golang.org/x/image/font"
|
||||
@@ -54,7 +56,7 @@ type Font struct {
|
||||
|
||||
// Face implements text layout and shaping for a particular font.
|
||||
type Face interface {
|
||||
Layout(ppem fixed.Int26_6, str string, opts LayoutOptions) []Line
|
||||
Layout(ppem fixed.Int26_6, txt io.Reader, opts LayoutOptions) ([]Line, error)
|
||||
Shape(ppem fixed.Int26_6, str []Glyph) op.CallOp
|
||||
Metrics(ppem fixed.Int26_6) font.Metrics
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user