Skip to main content

Configuring ImageMagick to use Pango on macOS

I recently had the occasion to use ImageMagick (IM) to create a PNG image from Pango markup. Both IM and Pango had been installed via macports, yet IM complained that there was no decode delegate for this image format.

Running:

$ convert -list format | fgrep -i pango

returned the following:

PANGO* PANGO     ---   Pango Markup Language

The '---' indicates that IM doesn't know how to read or write Pango markup.

A fair amount of searching turned up only old postings about uninstalling both IM and Pango, reinstalling Pango, then reinstalling IM. This didn't help. In fact, completely removing and reinstalling macports didn't help.

I dug in some more and reviewed the contents of the portfile for IM, which was located at /opt/local/var/macports/registry/portfiles/ImageMagick-6.9.7-4_0/*/Portfile. It was here that I found the default configure.args contained --without-pango and that there was a port variant named pango. After this discovery, I again uninstalled IM and reinstalled via:

$ sudo port install imagemagick +pango

When installed with the pango variant, per the above, IM could successfully process Pango ML input.