MCPcopy Create free account
hub / github.com/tdewolff/canvas / LoadSystemFont

Function LoadSystemFont

font.go:245–251  ·  view source on GitHub ↗

LoadSystemFont loads a font from the system's fonts.

(name string, style FontStyle)

Source from the content-addressed store, hash-verified

243
244// LoadSystemFont loads a font from the system's fonts.
245func LoadSystemFont(name string, style FontStyle) (*Font, error) {
246 filename, ok := FindSystemFont(name, style)
247 if !ok {
248 return nil, fmt.Errorf("failed to find font '%s'", name)
249 }
250 return LoadFontFile(filename, style)
251}
252
253// LoadFontFile loads a font from a file.
254func LoadFontFile(filename string, style FontStyle) (*Font, error) {

Callers 2

LoadLocalFontFunction · 0.85
LoadSystemFontMethod · 0.85

Calls 2

FindSystemFontFunction · 0.85
LoadFontFileFunction · 0.85

Tested by

no test coverage detected