Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dikkadev/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.
https://github.com/dikkadev/goafm
Last synced: 3 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/dikkadev/goafm
- Owner: dikkadev
- License: gpl-3.0
- Created: 2023-02-03T11:57:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T08:27:10.000Z (almost 2 years ago)
- Last Synced: 2024-12-22T05:10:26.952Z (6 days ago)
- Language: Go
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
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`.
```go
package mainimport (
"fmt""github.com/Sett17/goafm"
)func main() {
font, err := goafm.ParseFile("font.afm")
if err != nil {
panic(err)
}
fmt.Printf("%#v", font)
}
```