LoadFontCollection loads a font from a collection file and uses the font at the specified index.
(filename string, index int, style FontStyle)
| 261 | |
| 262 | // LoadFontCollection loads a font from a collection file and uses the font at the specified index. |
| 263 | func 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 | |
| 271 | var nonameFonts = 0 |
| 272 |
no test coverage detected