https://github.com/mdp/smallfont
Small monospaced pixel font (8x8) and rasterizer for LED/LCD projects
https://github.com/mdp/smallfont
font rasterizer ssd1306
Last synced: about 1 year ago
JSON representation
Small monospaced pixel font (8x8) and rasterizer for LED/LCD projects
- Host: GitHub
- URL: https://github.com/mdp/smallfont
- Owner: mdp
- Created: 2017-02-05T01:24:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T16:25:33.000Z (over 9 years ago)
- Last Synced: 2025-04-10T23:52:48.050Z (about 1 year ago)
- Topics: font, rasterizer, ssd1306
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# SmallFont
[](https://travis-ci.org/mdp/smallfont)
Rasterize small fonts (8x8, 6x8 and 5x8 currently supported) for LED projects
## Example usage
```golang
package main
import "github.com/mdp/smallfont"
func main() {
message := []byte("smallfont")
img := image.NewRGBA(image.Rect(0, 0, 128, 32)) // 52Pi OLED size
ctx := smallfont.Context{
Font: smallfont.Font8x8,
Dst: img,
Color: color.Black,
}
err := ctx.Draw(message, 0, 0)
if err != nil {
fmt.Println(err)
}
f, _ := os.OpenFile("out.png", os.O_CREATE|os.O_RDWR, 0644)
defer f.Close()
png.Encode(f, img)
}
```
## License
MIT - Do with this as you please