Skip to content

tinygo-org/tinyfont

release
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cmd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.