With ImageMagick, how can you see all available fonts?

Image ManipulationImagemagickText2image

Image Manipulation Problem Overview


ImageMagick can draw text into a picture in a given font, how can I see all available fonts for my system?

Image Manipulation Solutions


Solution 1 - Image Manipulation

depending on your imagemagick version:

convert -list type       # for IM older than v6.3.5-7
convert -list font       # for newer versions

also the output format changed...

-- update For OsX (Answer from Charles Merriam) if the command above does not produce any results:

For a full tutorial with description see http://gothick.org.uk/2008/03/14/using-os-x-fonts-in-imagemagick/ for the rest &tldr:

# use fondu to convert fonts and update locatedb
sudo port install fondu 
cd /usr/local/share/fonts/
fondu /Library/Fonts/*.dfont
/etc/periodic/weekly/310.locate

# generate imagemagick type.xml 
cd ~
mkdir ~/.magick
wget http://www.imagemagick.org/Usage/scripts/imagick_type_gen
perl imagick_type_gen > ~/.magick/type.xml


Solution 2 - Image Manipulation

To list only the font names, do convert -list font | grep Font

Solution 3 - Image Manipulation

The fonts are a bit tricky. ImageMagick will not usually 'see' your system fonts. On OS/X, fonts are stored in a non-standard format.

Use convert -list font to see the fonts ImageMagick currently knows about. It may be blank.

ImageMagick looks for $HOME/.magick/type.xml for the list of fonts. If you are on OS/X, go see the well written tutorial at http://gothick.org.uk/2008/03/14/using-os-x-fonts-in-imagemagick/.

Solution 4 - Image Manipulation

If you have recently installed a font which is not appearing when using:

convert -list font

You can flush your font cache with:

fc-cache -f -v

Solution 5 - Image Manipulation

Your OS file system will list all your fonts.

But if you are asking about fonts that Imagemagick knows about for use by name, then use convert -list font to see all those fonts listed in its type.xml file.

If that shows nothing, then if you are on a unix-like platform, you can use the perl script by Anthony Thyssen to install your fonts into the type.xml file rather than doing them by hand. See https://www.imagemagick.org/Usage/scripts/imagick_type_gen.

Then doing convert -list font should list the ones that Imagemagick recognizes and you can then use them by name -font fontname . Otherwise, you need to provide the full path to the font file -font path/to/font.suffx.

Solution 6 - Image Manipulation

I find the gnome-font-viewer more useful to see all the fonts visually compared to a list of names returned on the command line.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionflybywireView Question on Stackoverflow
Solution 1 - Image ManipulationNikoView Answer on Stackoverflow
Solution 2 - Image ManipulationHost LawnView Answer on Stackoverflow
Solution 3 - Image ManipulationCharles MerriamView Answer on Stackoverflow
Solution 4 - Image ManipulationPaul JView Answer on Stackoverflow
Solution 5 - Image Manipulationfmw42View Answer on Stackoverflow
Solution 6 - Image ManipulationSharunView Answer on Stackoverflow