How to add a simple text label to an image in Go?
问题 Given image.RGBA , coordinates, and a line of text, how do I add a simple label with any plain fixed font? E.g. Face7x13 from font/basicfont. package main import ( "image" "image/color" "image/png" "os" ) func main() { img := image.NewRGBA(image.Rect(0, 0, 320, 240)) x, y := 100, 100 addLabel(img, x, y, "Test123") png.Encode(os.Stdout, img) } func addLabel(img *image.RGBA, x, y int, label string) { col := color.Black // now what? } Alignment doesn't really matter, but best if I could write