The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

TITLE

ttfeval - wrapper for short Font::TTF hacks

SYNOPSIS

tteval [options] infont.ttf ...

OPTIONS

-mmodule
-Mmodule
-M'module ...'
-[mM]module=arg[,arg]...
-e commandline

Work essentially like the same options for Perl. See perlrun.

-o outfont

Indicates that you want an output font written, and names the font file. May take globs or be a directory.

-?

Verbose help.

DESCRIPTION

ttfeval is a wrapper for those one- or two-line font hacks. It does the work of including the Font::TTF module, opening the input font file, and optionally writing the output font file. You just supply the code in the middle. For example, to list out all the glyph names of a font, use:

 ttfeval -e 'print join("\n",@{$f->{'post'}->read->{'VAL'}});' myfont.ttf

Like the perl command line, you can specify multiple -e options to build up a multiline program, and you can include additional modules via the -m and -M options.

When the caller-supplied expression is executed, $f holds the result of the Font::TTF::Font->open() function and elements of @ARGV up to and including the input font name have been deleted -- you can use any remaining arguments for your own purposes. $infont and $outfile hold the names of the input and optional output font files -- changing $infont has no effect, but setting or clearing $outfile will change the output.

 ttfeval -e 'print $f->{'name'}->read->find_name(4) . "\n"' *.ttf