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

Method LoadFontCollection

font.go:447–455  ·  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

445
446// LoadFontCollection loads a font from a collection file and uses the font at the specified index.
447func (family *FontFamily) LoadFontCollection(filename string, index int, style FontStyle) error {
448 font, err := LoadFontCollection(filename, index, style)
449 if err != nil {
450 return err
451 }
452 family.fonts[style] = font
453 font.name = family.name
454 return nil
455}
456
457// MustLoadFontCollection loads a font from a collection file and uses the font at the specified index. It panics on error.
458func (family *FontFamily) MustLoadFontCollection(filename string, index int, style FontStyle) {

Callers 1

Calls 1

LoadFontCollectionFunction · 0.85

Tested by

no test coverage detected