fontmanager

package
v0.0.0-...-600f1e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STANDARD_NORMAL      = "standard_normal"
	STANDARD_ITALIC      = "standard_italic"
	STANDARD_BOLD        = "standard_bold"
	STANDARD_BOLD_ITALIC = "standard_bold_italic"

	MONO_NORMAL      = "mono_normal"
	MONO_ITALIC      = "mono_italic"
	MONO_BOLD        = "mono_bold"
	MONO_BOLD_ITALIC = "mono_bold_italic"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FontManager

type FontManager struct {
	FS fs.FS
	// contains filtered or unexported fields
}

func Create

func Create() *FontManager

func CreateWithFS

func CreateWithFS(filesystem fs.FS) *FontManager

func (*FontManager) GetFace

func (fm *FontManager) GetFace(name string, size float64) (font.Face, error)

func (*FontManager) GetFaceWithSpacing

func (fm *FontManager) GetFaceWithSpacing(name string, size float64, lineHeight float64) (font.Face, error)

func (*FontManager) LoadFont

func (fm *FontManager) LoadFont(name string, path string) error

func (*FontManager) LoadFontData

func (fm *FontManager) LoadFontData(name string, fontData []byte) error

func (*FontManager) LoadMonoFonts

func (fm *FontManager) LoadMonoFonts() error

This function loads the mono gofonts into the manager

It loads the mono, monoitalic, monobold, and monobolditalic fonts

see https://pkg.go.dev/golang.org/x/image/font/gofont

func (*FontManager) LoadStandardFonts

func (fm *FontManager) LoadStandardFonts() error

This function loads the standard san-serif gofonts into the manager

It loads the regular, italic, bold, and bolditalic fonts

see https://pkg.go.dev/golang.org/x/image/font/gofont

func (*FontManager) PurgeCache

func (fm *FontManager) PurgeCache()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL