Versions in this module Expand all Collapse all v0 v0.2.0 Aug 19, 2021 v0.1.0 Mar 14, 2019 Changes in this version + const HintingFull + const HintingNone + const HintingVertical + func Color4RGBA(c *math32.Color4) color.RGBA + func StrCount(s string) int + func StrFind(s string, pos int) (start, length int) + func StrInsert(s, data string, col int) string + func StrPrefix(text string, pos int) string + func StrRemove(s string, col int) string + type Atlas struct + Ascent int + Chars []CharInfo + Descent int + Height int + Image *image.RGBA + func NewAtlas(font *Font, first, last rune) *Atlas + func (a *Atlas) SavePNG(filename string) error + type Canvas struct + RGBA *image.RGBA + func NewCanvas(width, height int, bgColor *math32.Color4) *Canvas + func (c Canvas) DrawText(x, y int, text string, f *Font) + func (c Canvas) DrawTextCaret(x, y int, text string, f *Font, line, col int) error + type CharInfo struct + Height int + OffsetX float32 + OffsetY float32 + RepeatX float32 + RepeatY float32 + Width int + X int + Y int + type Font struct + func NewFont(ttfFile string) (*Font, error) + func NewFontFromData(fontData []byte) (*Font, error) + func (f *Font) DrawText(text string) *image.RGBA + func (f *Font) DrawTextOnImage(text string, x, y int, dst *image.RGBA) + func (f *Font) MeasureText(text string) (int, int) + func (f *Font) Metrics() font.Metrics + func (f *Font) SetAttributes(fa *FontAttributes) + func (f *Font) SetBgColor(color *math32.Color4) + func (f *Font) SetColor(fg *math32.Color4) + func (f *Font) SetDPI(dpi float64) + func (f *Font) SetFgColor(color *math32.Color4) + func (f *Font) SetHinting(hinting font.Hinting) + func (f *Font) SetLineSpacing(spacing float64) + func (f *Font) SetPointSize(size float64) + type FontAttributes struct + DPI float64 + Hinting font.Hinting + LineSpacing float64 + PointSize float64