Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultFonts ¶
func GetDefaultFonts() []string
GetDefaultFonts returns an ordered list of preferred fonts.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles font loading and caching. fonts caches parsed *truetype.Font objects (read-only after parse, safe to share). Faces are NOT cached — each caller gets its own face with its own GlyphBuf, since truetype.face is not safe for concurrent use.
func NewManager ¶
NewManager returns the process-wide font manager singleton. The logger from the first call is used; subsequent calls ignore their logger.
func (*Manager) GetFace ¶
GetFace returns a new font face with the specified size. A fresh face is returned on every call — truetype.face is not safe for concurrent use (it wraps a mutable GlyphBuf), so callers must not share faces.
func (*Manager) LoadBestAvailableFont ¶
LoadBestAvailableFont tries to load fonts in order of preference.