From 1331f3b5642f521236fcb1ec21ee43d5b76c0b91 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sun, 14 Apr 2019 22:30:40 +0200 Subject: Move commands under cmd/ --- bdf-sample/main.go | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 bdf-sample/main.go (limited to 'bdf-sample') diff --git a/bdf-sample/main.go b/bdf-sample/main.go deleted file mode 100644 index 1850118..0000000 --- a/bdf-sample/main.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "image" - "image/draw" - "image/png" - "log" - "os" - - "janouch.name/sklad/bdf" -) - -func main() { - fi, err := os.Open(os.Args[1]) - if err != nil { - log.Fatalln(err) - } - defer fi.Close() - font, err := bdf.NewFromBDF(fi) - if err != nil { - log.Fatalln(err) - } - - r, _ := font.BoundString(font.Name) - super := r.Inset(-20) - - img := image.NewRGBA(super) - draw.Draw(img, super, image.White, image.ZP, draw.Src) - font.DrawString(img, image.ZP, font.Name) - - fo, err := os.Create("out.png") - if err != nil { - log.Fatalln(err) - } - if err := png.Encode(fo, img); err != nil { - fo.Close() - log.Fatal(err) - } - if err := fo.Close(); err != nil { - log.Fatal(err) - } -} -- cgit v1.2.3-70-g09d2