Skip to content

mdp/smallfont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smallfont

SmallFont

Build Status

Rasterize small fonts (8x8, 6x8 and 5x8 currently supported) for LED projects

Example usage

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

About

Small monospaced pixel font (8x8) and rasterizer for LED/LCD projects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages