setting text color in freetype library (https://github.com/golang/freetype)

79 views
Skip to first unread message

zakaria amine

unread,
Aug 1, 2018, 12:38:47 PM8/1/18
to golang-nuts
Hi, 

I am trying to set the color for the text drwan using freetype library based on this example: 

I tried different combinations without luck. 


Anybody having used this library before?


Thanks.

Zakaria 


diarse...@gmail.com

unread,
Sep 14, 2018, 8:30:17 PM9/14/18
to golang-nuts
just set the Src to the color you want and it will change the color 
fg := image.Black
d := &font.Drawer{
       Dst: rgba,
       Src: fg,  //<-----
Face: truetype.NewFace(f, &truetype.Options{
Size: *size,
DPI: *dpi,
Hinting: h,
}),
   }
Reply all
Reply to author
Forward
0 new messages