Documentation
¶
Index ¶
- Constants
- type FontManager
- func (fm *FontManager) Clear()
- func (fm *FontManager) GetFace(name string, size float64) (text.Face, error)
- func (fm *FontManager) LoadFont(name string, path string) error
- func (fm *FontManager) LoadFontData(name string, fontData []byte) error
- func (fm *FontManager) LoadMonoFonts() error
- func (fm *FontManager) LoadStandardFonts() error
- func (fm *FontManager) PurgeCache()
- func (fm *FontManager) Remove(key string)
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 ¶
func Create ¶
func Create() *FontManager
func CreateWithFS ¶
func CreateWithFS(filesystem fs.FS) *FontManager
func (*FontManager) Clear ¶
func (fm *FontManager) Clear()
This function will remove all font data and the font cache in this Manager.
func (*FontManager) GetFace ¶
func (fm *FontManager) GetFace(name string, size float64) (text.Face, error)
This function returns a font face for the loaded font with 'name'. It will cache this face for future use.
func (*FontManager) LoadFont ¶
func (fm *FontManager) LoadFont(name string, path string) error
This function loads a font at the provided filesystem path.
func (*FontManager) LoadFontData ¶
func (fm *FontManager) LoadFontData(name string, fontData []byte) error
This function loads a font from the provided byte array
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
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
func (*FontManager) PurgeCache ¶
func (fm *FontManager) PurgeCache()
This function will clear the font cache
func (*FontManager) Remove ¶
func (fm *FontManager) Remove(key string)
This function will remove the specified font data
Click to show internal directories.
Click to hide internal directories.