|
- package text
-
- import (
- "git.wtrh.nl/patterns/gopatterns/pkg/point"
- "github.com/tdewolff/canvas"
- )
-
- type Text struct {
- point.Point
- anchor string
- text string
- }
-
- func NewText(point point.Point, anchor string, text string) *Text {
- return &Text{Point: point, anchor: anchor, text: text}
- }
-
- func (t Text) ToCanvas(c *canvas.Canvas, face *canvas.FontFace) {
- text := canvas.NewTextLine(face, t.text, canvas.Left)
- c.RenderText(text, t.Matrix())
- }
|