MCPcopy
hub / github.com/tdewolff/canvas / LoadFontCollection

Function LoadFontCollection

font.go:263–269  ·  view source on GitHub ↗

LoadFontCollection loads a font from a collection file and uses the font at the specified index.

(filename string, index int, style FontStyle)

Source from the content-addressed store, hash-verified

261
262// LoadFontCollection loads a font from a collection file and uses the font at the specified index.
263func LoadFontCollection(filename string, index int, style FontStyle) (*Font, error) {
264 b, err := os.ReadFile(filename)
265 if err != nil {
266 return nil, fmt.Errorf("failed to load font file '%s': %w", filename, err)
267 }
268 return LoadFont(b, index, style)
269}
270
271var nonameFonts = 0
272

Callers 1

LoadFontCollectionMethod · 0.85

Calls 1

LoadFontFunction · 0.85

Tested by

no test coverage detected