Skip to content

Instantly share code, notes, and snippets.

@ajstarks
Created January 14, 2015 13:06
Show Gist options
  • Save ajstarks/f6db9732f2657260eaf7 to your computer and use it in GitHub Desktop.
Save ajstarks/f6db9732f2657260eaf7 to your computer and use it in GitHub Desktop.
fitlist.go
package main
import (
"os"
"github.com/ajstarks/deck/generate"
)
func main() {
list := []string{"One", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine", "Ten", "Eleven", "Twelve" }
top := 80.0
bottom := 20.0
left := 10.0
textsize := 10.0
x := left
y := top
deck := generate.NewSlides(os.Stdout, 1024, 768)
deck.StartDeck()
deck.StartSlide()
data := list[0:12]
spacing := (top - bottom) / float64(len(data)-1)
if spacing < textsize*2 {
textsize -= 1.0
}
for _, s := range data {
deck.Text(x, y, s, "sans", textsize, "black")
y -= spacing
}
deck.EndSlide()
deck.EndDeck()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment