12

When using ImageMagick from the command line, how do I specify a bold or italic font?

I have tried the -weight Bold and -style Italic arguments, but they have no effect, at least not on my Windows 7 system. I have tried calling typefaces by name (e.g., -font "Arial Bold Italic") but I get the base font (e.g., "Arial"). I'm using -annotate to overlay a string on a picture.

Thanks in advance for your help.

David Veeneman
  • 18,912
  • 32
  • 122
  • 187

2 Answers2

15

Try font name with hyphens: -font "Arial-Bold-Italic" - it worked on my Windows 7 (like you, I couldn't make -style option working). Order of styles (Bold-Italic) is important here.

To see all the fonts available to ImageMagick, use convert -list font (and additionally maybe >C:\fonts.txt, because the list is usually very long).

moropus
  • 3,672
  • 1
  • 22
  • 30
2

I had the same problem: -font "Arial-Italic" did not produce italic and -style resulted in an error. However, -font "Times-Italic" works. For whatever reason, many of the italic fonts listed with convert -list font are not functional. Times-Italic is the only one I found that actually produces italic text. I use GraphicsMagick 1.3.28 on Ubuntu 18.04.3 LTS.

Norbert S
  • 275
  • 2
  • 14