Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
0.7.0
---
- **all**
- fix: GetGlyph falls back to index 0 when rune is not found
- **build**
- use TinyGo latest release for CI builds
- **docs**
- add font licensing information to README
- **tinyfontgen-ttf**
- bugfix for generating multiple fonts
- **fontpreview**
- add font preview generator and README samples


0.6.0
---
- **modules**
- update to drivers 0.31.0


0.5.0
---
- **all**
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2019-2024 TinyGo Authors. All rights reserved.
Copyright (c) The TinyGo Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down
84 changes: 80 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,90 @@ TinyFont

[![Build](https://github.com/tinygo-org/tinyfont/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/tinygo-org/tinyfont/actions/workflows/build.yml)

TinyFont is a font/text package for [TinyGo](https://tinygo.org/) displays. It is heavily based on [Adafruit's GFX library](https://github.com/adafruit/Adafruit-GFX-Library).
TinyFont is a font/text package for [TinyGo](https://tinygo.org/) displays. It is heavily influenced by [Adafruit's GFX library](https://github.com/adafruit/Adafruit-GFX-Library).

![example](./images/tinyfont.png)
![example](./images/rubikmoonrocks.png)


This package is experimental and may change in the future. It has not been optimized for speed or memory..
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.
## Current Fonts

### freemono

![freemono sample](./images/freemono.png)

A monospaced serif font from the GNU FreeFont project. Available in regular, bold, oblique, and bold oblique styles at 9, 12, 18, and 24pt. Licensed under GPL v3.

### freesans

![freesans sample](./images/freesans.png)

A sans-serif font from the GNU FreeFont project. Available in regular, bold, oblique, and bold oblique styles at 9, 12, 18, and 24pt. Licensed under GPL v3.

### freeserif

![freeserif sample](./images/freeserif.png)

A proportional serif font from the GNU FreeFont project. Available in regular, bold, italic, and bold italic styles at 9, 12, 18, and 24pt. Licensed under GPL v3.

### gophers

![gophers sample](./images/gophers.png)

A decorative font featuring Go gopher-themed glyphs, created by @rakyll. Available at 14, 18, 22, 32, 58, and 121pt. Licensed under CC BY-NC 4.0.

### notoemoji

![notoemoji sample](./images/notoemoji.png)

Google's Noto Emoji font, providing a wide range of emoji glyphs. Available at 12, 16, and 20pt. Licensed under SIL Open Font License.

### notosans

![notosans sample](./images/notosans.png)

Google's Noto Sans font, designed to support text in all languages with a clean sans-serif appearance. Available at 12pt. Licensed under SIL Open Font License.

### proggy

![proggy sample](./images/proggy.png)

The classic Proggy programming font, a pixel-perfect monospaced bitmap font well suited for small displays. Available at 8pt.

### shnm

![shnm sample](./images/shnm.png)

The Shinonome (東雲) bitmap font family, a Japanese BDF bitmap font supporting Latin and JIS character sets. Available at 12pt. Licensed under a permissive open license from The Electronic Font Open Laboratory.

### org_01

![org_01 sample](./images/org_01.png)

Org_v01 by Orgdot. A tiny, stylized font with all characters fitting within a 6-pixel height.

### picopixel

![picopixel sample](./images/picopixel.png)

Picopixel by Sébastien Matos. A tiny pixel font with all characters fitting within a 6-pixel height.

### tiny3x3a2pt7b

![tiny3x3a2pt7b sample](./images/tiny3x3a2pt7b.png)

"Tiny3x3a" from FontStruct by Michaelangel007. An extremely compact 3×3 pixel font. Licensed under CC BY-NC-SA 3.0.

### tomthumb

![tomthumb sample](./images/tomthumb.png)

Tom Thumb, a 3×5 pixel monospaced bitmap font originally by Brian J. Swetland. One of the smallest legible fonts available. Licensed under the BSD 3-Clause License.

## 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
Expand All @@ -24,6 +96,10 @@ 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

## 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.

## Incompatibility warning

This package contains incompatible changes from [previous versions](https://github.com/tinygo-org/tinyfont/commit/a02e4495f8d64b671d923ec009e17c9da9e3e7f5).
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/hajimehoshi/go-jisx0208 v1.0.0
github.com/sago35/go-bdf v0.0.0-20200313142241-6c17821c91c4
golang.org/x/image v0.0.0-20220617043117-41969df76e82
tinygo.org/x/drivers v0.31.0
tinygo.org/x/drivers v0.35.0
)

require (
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ golang.org/x/image v0.0.0-20220617043117-41969df76e82/go.mod h1:doUCurBvlfPMKfmI
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
tinygo.org/x/drivers v0.31.0 h1:Q2RpvTRMtdmjHD2Xyn4e8WXsJZKpIny3Lg4hzG1dLu4=
tinygo.org/x/drivers v0.31.0/go.mod h1:ZdErNrApSABdVXjA1RejD67R8SNRI6RKVfYgQDZtKtk=
tinygo.org/x/drivers v0.34.0 h1:lw8ePJeUSn9oICKBvQXHC9TIE+J00OfXfkGTrpXM9Iw=
tinygo.org/x/drivers v0.34.0/go.mod h1:ZdErNrApSABdVXjA1RejD67R8SNRI6RKVfYgQDZtKtk=
tinygo.org/x/drivers v0.35.0 h1:cTK36tsI/S4Mg3hCPH0MBjV/ta7XKQ+wpvch4mVqgsE=
tinygo.org/x/drivers v0.35.0/go.mod h1:DQgKyHkB4G6IEOKVTAjApbKnWGwESN91EVJO+nMOE9Y=
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ package tinyfont
// for support purposes.
//
// Update this value before release of new version of software.
const Version = "0.6.0"
const Version = "0.7.0"