dejavu
provides the DejaVu fonts as importable Go packages.
The fonts are released under the DejaVu font license. The Go packages under the BSD-3 license.
import (
"fmt"
"log"
"github.com/go-fonts/dejavu/dejavumathtexgyre"
"golang.org/x/image/font/sfnt"
)
func Example() {
ttf, err := sfnt.Parse(dejavumathtexgyre.TTF)
if err != nil {
log.Fatalf("could not parse DejaVu Math font: %+v", err)
}
fmt.Printf("num glyphs: %d\n", ttf.NumGlyphs())
// Output:
// num glyphs: 4282
}