tinyfontgen-ttf
Generate a font file for tinyfont project.
Description
By default, all ASCII characters are included.
To save font flash size, you can delete the output Glyph on a line-by-line basis.
If you want to include non-ASCII characters, you can use one of the following methods
- Specify the -all option to output all characters contained in the ttf font.
- Outputs all characters contained in the string specified by -string
- Output all characters in the file specified by -string-file.
- Fonts generated by tinyfontgen-ttf are 2-bit-color, so they will not display well on non color LCDs.
- In the current version, the background must be white
usage: tinyfontgen-ttf [flags] [path ...]
-all
include all ascii glyphs (codepoint <= 255) in the font
-ascii
include all glyphs in the font (default true)
-dpi int
dpi for font (default 75)
-fontname string
font name (default "TinyFont")
-output string
output path
-package string
package name (default "main")
-size int
size for font (default 12)
-string string
strings for font
-string-file value
strings file for font (can be set multiple times)
-verbose
run verbosely
-yadvance int
new line distance
Examples
RubikMoonrocks
https://fonts.google.com/specimen/Rubik+Moonrocks?query=rub
$ go run ./cmd/tinyfontgen-ttf --size 32 --package rubikmoonrocks --fontname RubikMoonrocks ./RubikMoonrocks-Regular.ttf --output rubikmoonrocks/font.go
Installation
go install tinygo.org/x/tinyfont/cmd/tinyfontgen-ttf@latest
License
This project is licensed under the BSD 3-clause license, just like the Go project itself.