https://github.com/liamg/fontinfo
Go package to list/match available fonts on a Linux system
https://github.com/liamg/fontinfo
fontconfig fonts
Last synced: about 1 year ago
JSON representation
Go package to list/match available fonts on a Linux system
- Host: GitHub
- URL: https://github.com/liamg/fontinfo
- Owner: liamg
- License: apache-2.0
- Created: 2021-05-17T20:46:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T22:42:44.000Z (about 2 years ago)
- Last Synced: 2025-02-27T04:24:51.956Z (over 1 year ago)
- Topics: fontconfig, fonts
- Language: Go
- Homepage: https://pkg.go.dev/github.com/liamg/fontinfo
- Size: 13.7 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FontInfo
[](https://pkg.go.dev/github.com/liamg/fontinfo)
[](https://goreportcard.com/report/github.com/liamg/fontinfo)
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
```go
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)
}
}
```