diff --git a/examples/mixedfont/main.go b/examples/mixedfont/main.go index f50ce6c52..d54c3e9c0 100644 --- a/examples/mixedfont/main.go +++ b/examples/mixedfont/main.go @@ -74,7 +74,7 @@ func (g *Game) Update() error { Size: 32, } - g.face = text.NewMultiFace([]text.Face{en, ja}) + g.face = text.NewMultiFace(en, ja) } return nil } diff --git a/text/v2/multi.go b/text/v2/multi.go index e38bbf439..a44169fdb 100644 --- a/text/v2/multi.go +++ b/text/v2/multi.go @@ -31,11 +31,10 @@ type MultiFace struct { } // NewMultiFace creates a new MultiFace from the given faces. -func NewMultiFace(faces []Face) *MultiFace { - m := &MultiFace{} - m.faces = make([]Face, len(faces)) - copy(m.faces, faces) - return m +func NewMultiFace(faces ...Face) *MultiFace { + return &MultiFace{ + faces: faces, + } } // Metrics implements Face.