Example #1
0
func main() {

	deck := generate.NewSlides(os.Stdout, 1024, 768)
	deck.StartDeck()
	deck.StartSlide()
	w := 100.0
	h := 100.0
	pw := 10.0
	ph := 10.0
	percent := 10.0
	fs := 3.0
	for x, pl := 0.0, 0.0; x <= w; x += pw {
		deck.Line(x, 0, x, h, 0.1, "steelblue", 50)
		if pl > 0 && pl < 100 {
			deck.TextMid(x, h-percent/2, fmt.Sprintf("%.0f", pl), "sans", fs, "gray")
		}
		pl += percent
	}
	for y, pl := 0.0, 0.0; y <= h; y += ph {
		deck.Line(0, y, w, y, 0.1, "steelblue", 50)
		if pl > 0 && pl < 100 {
			deck.TextMid(percent/2, y-(fs/2), fmt.Sprintf("%.0f", pl), "sans", fs, "gray")
		}
		pl += percent
	}
	deck.EndSlide()

	deck.EndDeck()
}
Example #2
0
func main() {
	deck := generate.NewSlides(os.Stdout, 1600, 900) // 16x9 deck to standard output
	deck.StartDeck()                                 // start the deck

	// Text alignment
	deck.StartSlide("rgb(180,180,180)")
	deck.Text(50, 80, "Left", "sans", 10, "black")
	deck.TextMid(50, 50, "Center", "sans", 10, "gray")
	deck.TextEnd(50, 20, "Right", "sans", 10, "white")
	deck.Line(50, 100, 50, 0, 0.2, "black", 20)
	deck.EndSlide()

	// List
	items := []string{"First", "Second",
		"Third", "Fourth", "Fifth"}
	deck.StartSlide()
	deck.Text(10, 90, "Important Items", "sans", 5, "")
	deck.List(10, 70, 4, items, "bullet", "sans", "red")
	deck.EndSlide()

	// Picture with text annotation
	quote := "Yours is some tepid, off-brand, generic ‘cola’. " +
		"What I’m making is “Classic Coke”"
	person := "Heisenberg"
	deck.StartSlide("black", "white")
	deck.Image(50, 50, 1440, 900, "classic-coke.png")
	deck.TextBlock(10, 80, quote, "sans", 2.5, 30, "")
	deck.Text(65, 15, person, "sans", 1.2, "")
	deck.EndSlide()

	deck.EndDeck() // end the deck
}
Example #3
0
func main() {

	cmd := []string{
		"build",
		"clean",
		"env",
		"fix",
		"fmt",
		"generate",
		"get",
		"install",
		"list",
		"run",
		"test",
		"tool",
		"version",
		"vet"}

	desc := []string{
		"compile packages and dependencies",
		"remove object files",
		"print Go environment information",
		"run go tool fix on packages",
		"run gofmt on package sources",
		"generate Go files by processing source",
		"download and install packages and dependencies",
		"compile and install packages and dependencies",
		"list packages",
		"compile and run Go program",
		"test packages",
		"run specified go tool",
		"print Go version",
		"run go tool vet on packages",
	}

	deck := generate.NewSlides(os.Stdout, 1024, 768)
	deck.StartDeck()
	deck.StartSlide()
	fit(deck, 95, 5, 15, 2.5, "black", cmd, true)
	fit(deck, 95, 5, 30, 2.5, "gray", desc, false)
	deck.EndSlide()
	deck.EndDeck()

}