diff --git a/text/shaper.go b/text/shaper.go index 0337b0c7..e81a9994 100644 --- a/text/shaper.go +++ b/text/shaper.go @@ -177,15 +177,9 @@ func NewShaper(collection []FontFace) *Shaper { return l } -// Layout a text according to a set of options. Results can be retrieved by -// iteratively calling NextGlyph. -func (l *Shaper) Layout(params Parameters, minWidth, maxWidth int, lc system.Locale, txt io.RuneReader) { - l.layoutText(params, minWidth, maxWidth, lc, txt, "") -} - // Layout text from an io.Reader according to a set of options. Results can be retrieved by // iteratively calling NextGlyph. -func (l *Shaper) LayoutReader(params Parameters, minWidth, maxWidth int, lc system.Locale, txt io.Reader) { +func (l *Shaper) Layout(params Parameters, minWidth, maxWidth int, lc system.Locale, txt io.Reader) { l.layoutText(params, minWidth, maxWidth, lc, bufio.NewReader(txt), "") } diff --git a/text/shaper_test.go b/text/shaper_test.go index ca8cc6d1..a150c3dc 100644 --- a/text/shaper_test.go +++ b/text/shaper_test.go @@ -113,7 +113,7 @@ func TestShapingNewlineHandling(t *testing.T) { } checkGlyphs() - cache.LayoutReader(Parameters{ + cache.Layout(Parameters{ Alignment: Middle, PxPerEm: fixed.I(10), }, 200, 200, english, strings.NewReader(tc.textInput)) diff --git a/widget/text.go b/widget/text.go index 615c679f..5c1efd83 100644 --- a/widget/text.go +++ b/widget/text.go @@ -399,7 +399,7 @@ func (e *textView) layoutText(lt *text.Shaper) { e.index = glyphIndex{} it := textIterator{viewport: image.Rectangle{Max: image.Point{X: math.MaxInt, Y: math.MaxInt}}} if lt != nil { - lt.LayoutReader(text.Parameters{ + lt.Layout(text.Parameters{ Font: e.font, PxPerEm: e.textSize, Alignment: e.Alignment,