LoadSystemFont loads a font from the system's fonts.
(name string, style FontStyle)
| 243 | |
| 244 | // LoadSystemFont loads a font from the system's fonts. |
| 245 | func 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. |
| 254 | func LoadFontFile(filename string, style FontStyle) (*Font, error) { |
no test coverage detected