Module to retrieve general TTF font info

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm attempting to find a module that will allow me to retrieve general
information regarding a TrueType font.

Typeface Name
File Size
Author, Copyright info and/or Comments
(Basically what you would see as a header when you double click a ttf
file in windows)

I'm particularly interested in the Author info, but I am not sure which
modules will do this. Anyone have a clue? I tried looking into
Font::TTF::Font and Font::FreeType but was unable to find a solution.
Any help would greatly be appreciated.


Re: Module to retrieve general TTF font info writes:

Quoted text here. Click to load it

You can do that using Font::TTF::Font.  Here's an example:

  use Font::TTF::Font;

  my $f = Font::TTF::Font->open($ARGV[0]);
  my $t = $f->->read;

  print $t->[6][1][0], "\n";
  print $t->[0][1][0], "\n";

This will print the PostScript name and the copyright information of
a font specified on the command line.

Have a look at the Font::TTF::Name(3) man page and

for details about the numbers.


Public key at <

Site Timeline