font.go 588 B

12345678910111213141516171819202122232425262728
  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. // +build linux darwin
  6. package font
  7. // Default returns the default system font.
  8. // The font is encoded as a TTF.
  9. func Default() []byte {
  10. b, err := buildDefault()
  11. if err != nil {
  12. panic(err)
  13. }
  14. return b
  15. }
  16. // Monospace returns the default system fixed-pitch font.
  17. // The font is encoded as a TTF.
  18. func Monospace() []byte {
  19. b, err := buildMonospace()
  20. if err != nil {
  21. panic(err)
  22. }
  23. return b
  24. }