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%
Find a file
2023-02-09 16:48:10 +01:00
.github/workflows Initial commit 2023-02-03 12:59:51 +01:00
.idea Initial commit 2023-02-03 12:59:51 +01:00
afm.go get metrics for non encoded characters with byRune 2023-02-06 11:17:48 +01:00
afm_test.go get metrics for non encoded characters with byRune 2023-02-06 11:17:48 +01:00
afmError.go Initial commit 2023-02-03 12:59:51 +01:00
aglfn.go get metrics for non encoded characters with byRune 2023-02-06 11:17:48 +01:00
aglfn2go.ipynb get metrics for non encoded characters with byRune 2023-02-06 11:17:48 +01:00
array.go Initial commit 2023-02-03 12:59:51 +01:00
array_test.go Initial commit 2023-02-03 12:59:51 +01:00
bench_test.go Initial commit 2023-02-03 12:59:51 +01:00
boolean.go Initial commit 2023-02-03 12:59:51 +01:00
charMatric.go get metrics for non encoded characters with byRune 2023-02-06 11:17:48 +01:00
charMatric_test.go Initial commit 2023-02-03 12:59:51 +01:00
composite.go Initial commit 2023-02-03 12:59:51 +01:00
composite_test.go Initial commit 2023-02-03 12:59:51 +01:00
DOCS.md Update docs 2023-02-06 10:18:47 +00:00
go.mod Initial commit 2023-02-03 12:59:51 +01:00
goafm.iml get metrics for non encoded characters with byRune 2023-02-06 11:17:48 +01:00
kernPair.go Initial commit 2023-02-03 12:59:51 +01:00
kernPair_test.go Initial commit 2023-02-03 12:59:51 +01:00
kernTrack.go Initial commit 2023-02-03 12:59:51 +01:00
kernTrack_test.go Initial commit 2023-02-03 12:59:51 +01:00
LICENSE Create LICENSE 2023-02-09 16:48:10 +01:00
misc.go Initial commit 2023-02-03 12:59:51 +01:00
misc_test.go Initial commit 2023-02-03 12:59:51 +01:00
number.go Initial commit 2023-02-03 12:59:51 +01:00
number_test.go Initial commit 2023-02-03 12:59:51 +01:00
readme.md Initial commit 2023-02-03 12:59:51 +01:00
Times-Roman.afm Initial commit 2023-02-03 12:59:51 +01:00

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)
}