Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Getting a list of all client side fonts using ImageMagik?

Getting a list of all client side fonts using ImageMagik?


I'm looked around and saw a lot of questions about getting Installed Fonts on a system, but most of them are asking in the opposite way that I am. People are saying 'Is font x installed on the system', instead I am looking for 'What fonts are installed on the system'. In a different post I noticed that someone had gotten the information from ImageMagik using the following code:

foreach($fonts as $font)
    echo $font;

This displays the following







Though it doesn't seem it displays the CLIENT side fonts, instead it displays the fonts on the SERVER side. Is this true?

If this is true, is there a way to display ALL client side fonts using ImageMagik or possibly a different library?

Problem courtesy of: andriynoble


The code which runs serverside is completely different from the code running on the client. It is possible to get a list of the fonts available on the client but not using HTML/CSS/Javascript although you can test for the presence of specific fonts using HTML/CSS/javascript - see the section on fonts here.

It would help to know what you were trying to achieve - CSS already has a method for declaring alternate fonts.

Solution courtesy of: symcbean


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Getting a list of all client side fonts using ImageMagik?


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription