//Command line
convert composite.png -gravity south -size 70x -font Montserrat-Bold.tff -pointsize 8 -fill "#cecece" -background transparent caption:"My amazing caption" -composite result.png
This work fine!
And my code representation is:
Code: Select all
MagickWand *mwc = NULL;
DrawingWand *dw = NULL;
PixelWand *pw = NULL;
mwc = NewMagickWand();
dw = NewDrawingWand();
pw = NewPixelWand();
MagickSetGravity(mwc, SouthGravity);
MagickSetSize(mwc, 70,20);
MagickSetFont(mwc, "Montserrat-Bold.ttf");
MagickSetPointsize(mwc, 8);
PixelSetColor(pw, "#cecece");
//I can set the Background color but what about the font color?
PixelSetColor(pw, "transparent");
MagickSetBackgroundColor(mwc, pw);
MagickReadImage(mwc, "caption: My amazing caption");
MagickWriteImage(mwc, "final.png");