erm/vendor/github.com/liamg/fontinfo
Liam Galvin 41f8406484
Fix font loading for home dirs (#309)
* Update fontinfo to v0.1.1

* Fix font loading
2021-08-04 21:01:31 +01:00
..
LICENSE Initial commit 2021-07-30 23:29:20 +01:00
README.md Initial commit 2021-07-30 23:29:20 +01:00
go.mod Initial commit 2021-07-30 23:29:20 +01:00
list.go Initial commit 2021-07-30 23:29:20 +01:00
match.go Fix font loading for home dirs (#309) 2021-08-04 21:01:31 +01:00
matchers.go Initial commit 2021-07-30 23:29:20 +01:00
parse.go Initial commit 2021-07-30 23:29:20 +01:00

README.md

FontInfo

Go Reference GoReportCard

FontInfo is a Go package to list available fonts on a Linux system.

  • No CGO required
  • Doesn't wrap fontconfig or other utilities
  • Pure Go
  • No external dependencies
  • Provides family and style for each font
  • Supports TTF and OTF
  • Fast (typically parses 1k fonts in ~100ms)

Example

package main

import (
	"fmt"

	"github.com/liamg/fontinfo"
)

func main() {

	fonts, err := fontinfo.List()
	if err != nil {
		panic(err)
	}

	for _, font := range fonts {
		fmt.Printf("Family=%s Style=%s Path=%s\n", font.Family, font.Style, font.Path)
	}
}