Center a text problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Center a text problem

Post by fmw42 »

If you have upgraded imagemagick and it does not work, then try upgrading freetype delegate as well. I am currently using freetype @2.8_0.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Center a text problem

Post by fmw42 »

Another way, similar to what GeeMack suggested is to create a much larger background image than you need, then specify the pint-size and use -annotate to draw the text. Then trim and extend to the size you want.

Code: Select all

convert -size 2000x2000 xc:red -fill white -font OpenSans -gravity center -pointsize 328 -annotate +0+0 "MR" -trim +repage -background red -extent 480x480 -density 144 MR2.png
Image
Post Reply