Documentation ¶
Index ¶
Constants ¶
View Source
const ( AlignLeft = iota AlignCenter AlignRight )
View Source
const (
DefaultFontSize = 12
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Font ¶
type Font interface { WithSize(size int) Font BoundString(text string) (bound egeom.Rectangle, advance int) // Size returns vertical font size in pixel. Size() int Face() font.Face }
func MustNewTrueTypeParse ¶
func NewTrueType ¶
func NewTrueTypeParse ¶
func NewTrueTypeParse(fontData []byte) (f Font, oc eoutcome.ParseOutcome)
type Style ¶
type Style interface { WithLineHeight(h float64) Style WithAlignment(a Alignment) Style WithFont(f Font) Style WithColor(c ecolor.Color) Style // Alignment is for specify text alignment Alignment() Alignment // LineHeight is a multiplier for font height. If you set 2.0 that means one empty line between the lines. LineHeight() float64 // Font returns font setting for this style Font() Font // Color returns color setting for this style Color() ecolor.Color Layout(text string, start egeom.Point, f func(s string, p egeom.Point)) (bound egeom.Rectangle) Bound(text string) (bound egeom.Rectangle) }
Click to show internal directories.
Click to hide internal directories.