How to get font info on *nix?

R

rmagick

I'm thinking about writing a Ruby extension for Linux/*BSD/Darwin to
enumerate all the fonts (Postscript and TTF) that are installed, along
with their attributes. Given such an extension I could write a Ruby
program to generate a custom ImageMagick font config file.

Can somebody enlighten me about where to start? Is there an existing
library I can leverage? I found fontconfig (www.fontconfig.org) but I'm
not sure that's right.
 
A

Austin Ziegler

I'm thinking about writing a Ruby extension for Linux/*BSD/Darwin to
enumerate all the fonts (Postscript and TTF) that are installed, along
with their attributes. Given such an extension I could write a Ruby
program to generate a custom ImageMagick font config file.

Can somebody enlighten me about where to start? Is there an existing
library I can leverage? I found fontconfig (www.fontconfig.org) but I'm
not sure that's right.

Take a look near the top of the PDF::Writer main file
(lib/pdf/writer.rb) and you'll see what I do in order to find existing
fonts. It's imperfect and somewhat untested, but you may need to parse
the fonts themselves to determine the relevant information.

-austin
 
T

Timothy Hunter

Austin said:
Take a look near the top of the PDF::Writer main file
(lib/pdf/writer.rb) and you'll see what I do in order to find existing
fonts. It's imperfect and somewhat untested, but you may need to parse
the fonts themselves to determine the relevant information.

Verrrry interesting...Thanks, Austin!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top