Question

is it possible to use web fonts to write some text over the image with a particular angle orientation, and which command should I use? Guess it for example a text going from a left bottom corner to the right top corner.

Here the working example code, that needs to be orientated:

convert -size 600x357 xc:none -draw "image Over 0,0 0,0 'background01.jpg'" \
        -pointsize 30 -font "geometricslab703bt-bold-webfont.ttf" -fill White \
        -draw "text 140,175 'mijn ideale'" -append +repage \
         result.jpg
Was it helpful?

Solution

You'll need to copy your TTF font file into a path your ImageMagick install is looking for fonts. For me, that's /usr/X11/share/fonts/TTF/.

sudo cp -p geoslab703-xbd-bt-extra-bold.ttf \
           /usr/X11/share/fonts/TTF/geoslab703-xbd-bt-extra-bold.ttf

You can verify that the font is available to you by running the identify utility.

identify -list font

And simply search for your font

  Font: GeoSlab703-XBd-BT-Extra-Bold
    family: GeoSlab703 XBd BT
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/X11/share/fonts/TTF/geoslab703-xbd-bt-extra-bold.ttf

For displaying at an angle

I would suggest doing all your text handling within a single -draw command

convert -size 600x357 xc:none -draw "image Over 0,0 0,0 'background01.jpg'" \
  -draw "font GeoSlab703-XBd-BT-Extra-Bold font-size 30 fill white \
         rotate -15 text 140,165 'mijn ideale'" \
  -append +repage result.jpg

More examples @ Text Handling Usage

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top