A Go library for parsing Adobe Font Metrics (AFM) files. Supports the full specification. Adobe Font Metrics (AFM) files provide information about the size, position, and spacing of characters in a font. They are used by software applications to correctly display text using a specific font.
- Go 84%
- Jupyter Notebook 16%
| .github/workflows | ||
| .idea | ||
| afm.go | ||
| afm_test.go | ||
| afmError.go | ||
| aglfn.go | ||
| aglfn2go.ipynb | ||
| array.go | ||
| array_test.go | ||
| bench_test.go | ||
| boolean.go | ||
| charMatric.go | ||
| charMatric_test.go | ||
| composite.go | ||
| composite_test.go | ||
| DOCS.md | ||
| go.mod | ||
| goafm.iml | ||
| kernPair.go | ||
| kernPair_test.go | ||
| kernTrack.go | ||
| kernTrack_test.go | ||
| LICENSE | ||
| misc.go | ||
| misc_test.go | ||
| number.go | ||
| number_test.go | ||
| readme.md | ||
| Times-Roman.afm | ||
goafm
A Go library for parsing Adobe Font Metrics (AFM) files. Supports the full specification.
Adobe Font Metrics (AFM) files provide information about the size, position, and spacing of characters in a font. They are used by software applications to correctly display text using a specific font. The goafm library provides a convenient way to parse AFM files and extract the information they contain.
Features
Parsing & extraction of the following information:
- Font metrics
- Character metrics
- Kerning pairs
- Track kerning
- Composites Characters
Installation
Use go get to install the library:
go get github.com/Sett17/goafm
Usage
ParseFile takes in a filename and returns a FontMetric pointer and an error.
Parse takes in a byte slice and returns a FontMetric pointer and an error.
package main
import (
"fmt"
"github.com/Sett17/goafm"
)
func main() {
font, err := goafm.ParseFile("font.afm")
if err != nil {
panic(err)
}
fmt.Printf("%#v", font)
}