Created
January 14, 2015 13:06
-
-
Save ajstarks/f6db9732f2657260eaf7 to your computer and use it in GitHub Desktop.
fitlist.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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