Skip to content

Commit 1cfe429

Browse files
sago35conejoninja
authored andcommitted
docs: update README.md
1 parent 9b135c3 commit 1cfe429

5 files changed

Lines changed: 67 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ TinyFont
55

66
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).
77

8-
![example](./tinyfont.png)
8+
![example](./images/tinyfont.png)
9+
![example](./images/rubikmoonrocks.png)
910

1011

1112
This package is experimental and may change in the future. It has not been optimized for speed or memory..
@@ -18,9 +19,10 @@ The fonts compiled here were just converted or made compatible, and the original
1819

1920
## Generate your own font
2021

21-
You can use tinyfontgen to generate a tinyfont from a bdf font.
22+
You can use tinyfontgen to generate a tinyfont from a bdf/ttf font.
2223

23-
https://github.com/tinygo-org/tinyfont/tree/release/cmd/tinyfontgen
24+
https://github.com/tinygo-org/tinyfont/tree/release/cmd/tinyfontgen
25+
https://github.com/tinygo-org/tinyfont/tree/release/cmd/tinyfontgen-ttf
2426

2527
## Incompatibility warning
2628

cmd/tinyfontgen-ttf/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# tinyfontgen-ttf
2+
3+
Generate a font file for tinyfont project.
4+
5+
* https://tinygo.org/x/tinyfont
6+
7+
## Description
8+
9+
By default, all ASCII characters are included.
10+
To save font flash size, you can delete the output Glyph on a line-by-line basis.
11+
If you want to include non-ASCII characters, you can use one of the following methods
12+
13+
* Specify the -all option to output all characters contained in the ttf font.
14+
* Outputs all characters contained in the string specified by -string
15+
* Output all characters in the file specified by -string-file.
16+
* Fonts generated by tinyfontgen-ttf are 2-bit-color, so they will not display well on non color LCDs.
17+
* In the current version, the background must be white
18+
19+
```
20+
usage: tinyfontgen-ttf [flags] [path ...]
21+
-all
22+
include all ascii glyphs (codepoint <= 255) in the font
23+
-ascii
24+
include all glyphs in the font (default true)
25+
-dpi int
26+
dpi for font (default 75)
27+
-fontname string
28+
font name (default "TinyFont")
29+
-output string
30+
output path
31+
-package string
32+
package name (default "main")
33+
-size int
34+
size for font (default 12)
35+
-string string
36+
strings for font
37+
-string-file value
38+
strings file for font (can be set multiple times)
39+
-verbose
40+
run verbosely
41+
-yadvance int
42+
new line distance
43+
```
44+
45+
## Examples
46+
47+
### RubikMoonrocks
48+
49+
https://fonts.google.com/specimen/Rubik+Moonrocks?query=rub
50+
51+
```
52+
$ go run ./cmd/tinyfontgen-ttf --size 32 --package rubikmoonrocks --fontname RubikMoonrocks ./RubikMoonrocks-Regular.ttf --output rubikmoonrocks/font.go
53+
```
54+
55+
## Installation
56+
57+
go install tinygo.org/x/tinyfont/cmd/tinyfontgen-ttf@latest
58+
59+
## License
60+
61+
[This project is licensed](../../LICENSE) under the BSD 3-clause license, just like the [Go project](https://golang.org/LICENSE) itself.

cmd/tinyfontgen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Approx. 127 bytes
9797

9898
## Installation
9999

100-
go get tinygo.org/x/tinyfont/cmd/tinyfontgen
100+
go install tinygo.org/x/tinyfont/cmd/tinyfontgen@latest
101101

102102
## License
103103

images/rubikmoonrocks.png

226 KB
Loading
File renamed without changes.

0 commit comments

Comments
 (0)