Google Fonts
This package provides a very limited number of Google Fonts, licensed under the Apache 2.0 license, that can be embedded in Go programs.
It is designed to be used with packages that can import TTF fonts as bytes such as github.com/essentialkaos/go-badge
.
Currenty, the following font families are supported:
- Roboto (on
fonts.google.com
)
The main.go
file in the root folder auto-generates Go files and is only needed for adding additional fonts.
Usage
import "github.com/grokify/google-fonts/roboto"
robotoRegularTTFBytes := roboto.RobotoRegular()
Adding fonts
- Download the zip file from fonts.google.com
- Unzip into new subfolder
- Lower-case the subfolder name
- Run
go run main.go <new_folder_name>