font.go 565 B

123456789101112131415161718192021222324252627
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build linux || darwin
  5. package font
  6. // Default returns the default system font.
  7. // The font is encoded as a TTF.
  8. func Default() []byte {
  9. b, err := buildDefault()
  10. if err != nil {
  11. panic(err)
  12. }
  13. return b
  14. }
  15. // Monospace returns the default system fixed-pitch font.
  16. // The font is encoded as a TTF.
  17. func Monospace() []byte {
  18. b, err := buildMonospace()
  19. if err != nil {
  20. panic(err)
  21. }
  22. return b
  23. }