ImageMagick fails to recognize non-default fonts on Windows 10

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?".
Locked
IMUser
Posts: 10
Joined: 2011-06-14T21:05:02-07:00
Authentication code: 8675308

ImageMagick fails to recognize non-default fonts on Windows 10

Post 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.

IMUser
Posts: 10
Joined: 2011-06-14T21:05:02-07:00
Authentication code: 8675308

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

Post 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.

User avatar
GeeMack
Posts: 757
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

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

Post 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.

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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

Locked