Page 1 of 1

ImageMagick fails to recognize non-default fonts on Windows 10

Posted: 2020-03-12T13:31:31-07:00
by IMUser
I have installed some Google and other fonts on my Windows 10. They were all recognized and could be used in other applications on my Windows 10.

On older versions of Windows, such as Windows 7, ImageMagick had no trouble recognizing additional fonts installed on Windows. ImageMagick even automatically recognized newly added fonts that were installed after ImageMagick installation.

Why does ImageMagick fail to recognize additional fonts on Windows 10? The following command outputs none of the additional fonts on my Windows 10 computer.

Code: Select all

magick -list font
How can this issue be fixed?

I've tried ImageMagick v7.0.10 Q16 and Q8, x64, dll.

Re: ImageMagick fails to recognize non-default fonts on Windows 10

Posted: 2020-03-12T14:13:54-07:00
by IMUser
I found a way to solve this problem.

Because Windows 10 enabled selling fonts in Microsoft Store, Windows 10 can install fonts for individual users.

If the font files are installed by copying them to c:\windows\fonts directory or by dragging-and-dropping the selected font files to the font installation box on the Settings -> Personalization -> Fonts window, magick.exe would not recognize the fonts because the fonts would be installed just for the user.

To make the fonts recognizable by magick.exe, select the font files to install, right-click the selected font files, and then select 'Install for all users'. After installing new fonts using this method,

Code: Select all

magick -list font
will display all the newly added fonts.

Re: ImageMagick fails to recognize non-default fonts on Windows 10

Posted: 2020-03-12T15:31:23-07:00
by GeeMack
IMUser wrote:
2020-03-12T14:13:54-07:00
After installing new fonts using this method, [...] will display all the newly added fonts.
I will frequently just use the actual font file itself. It doesn't even have to be installed.

Code: Select all

convert -font my_favorite_font.ttf -pointsize 24 label:"ABC123" out.png
I keep particular font files in folders with particular projects, and they stay there even if I move the project to another machine. That way the font will always be exactly the same even if I run the commands or script on another machine.

Re: ImageMagick fails to recognize non-default fonts on Windows 10

Posted: 2020-03-12T15:53:55-07:00
by fmw42
I expect that you will also need to provide your path to the font file.

Code: Select all

-font path_to\my_favorite_font.ttf