Custom fonts with ImageMagick and Apache

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?".
Post Reply
matt_aitch
Posts: 1
Joined: 2019-07-09T03:20:16-07:00
Authentication code: 1152

Custom fonts with ImageMagick and Apache

Post by matt_aitch » 2019-07-09T03:23:44-07:00

I have installed some custom TTF fonts for use with ImageMagick in order to convert an SVG file to a PNG.

The fonts are recognized by ImageMagick when the following command is run:

Code: Select all

convert -list font
The output from this command shows that the file /home/matt/.magick/type.xml has been read. The script I use to generate and convert the SVG file works and the output image correctly uses these fonts.

I am building a site that will convert dynamically generated SVG files so need the fonts to be available when the script is called from apache, via PHP exec.

I have copied the same type.xml file to /var/www/.magick but it is not picked up by ImageMagick.

When the same script is called via the site the custom fonts are substituted. Running the same command as above as the www-data user shows that the custom fonts I have added are not listed.

Code: Select all

sudo -u www-data convert -list font
Does anyone know why this might be happening or how I can make custom fonts available to ImageMagick when called via the apache user?

Post Reply