Open petric3 opened 11 months ago
Thank you for the great package. I try to study it and make some multi-line text, but it seems I cannot make it work. This is my code:
func main() { text := "Hello, World! \nHello, World! \nHello, World!" // const S = 1024 const W, H = 1024, 1024 dc := gg.NewContext(W, H) dc.SetRGB(1, 1, 1) dc.Clear() dc.SetRGB(0, 0, 0) if err := dc.LoadFontFace("/home/oem/Downloads/Verdana.ttf", 39); err != nil { panic(err) } dc.DrawStringAnchored(text, W/2, H/2, 0.5, 0.5) dc.SavePNG("out.png") }
And this is the result:
I also tried for example:
text := `Hello, World! Hello, World! Hello, World! `
but the result is the same. Is there any other way that I don't know of? Thank you!
you can use dc.DrawStringWrapped
Thank you for the great package. I try to study it and make some multi-line text, but it seems I cannot make it work. This is my code:
And this is the result:
I also tried for example:
but the result is the same. Is there any other way that I don't know of? Thank you!