Skip to content

tinygo-org/tinyfont

Repository files navigation

TinyFont

Build

TinyFont is a font/text package for TinyGo displays. It is heavily based on Adafruit's GFX library.

example example

This package is experimental and may change in the future. It has not been optimized for speed or memory..

Faster compilation

During compilation, tinygo will go through all the font files in a package and them discard them if not used. To improve compilation time considerably, move the files you are going to use to a new package.

About the fonts

The fonts compiled here were just converted or made compatible, and the original authors should be given proper credit. Each font is under its own license, and while most of them are under an open license, there might be differences in its usage and conditions.

Generate your own font

You can use tinyfontgen to generate a tinyfont from a bdf/ttf font.

https://github.com/tinygo-org/tinyfont/tree/release/cmd/tinyfontgen
https://github.com/tinygo-org/tinyfont/tree/release/cmd/tinyfontgen-ttf

Incompatibility warning

This package contains incompatible changes from previous versions.

  • The argument has been changed from []byte to string.
    • You can simply add a string() cast.
  • The Font struct has been changed.
    • If you are creating your own fonts, you need to modify them.
    • You may find this script helpful for font conversion.

License

This project is licensed under the BSD 3-clause license, just like the Go project itself.