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

NAME

ttfeval - wrapper for short Font::TTF hacks

SYNOPSIS

ttfeval [options] [progfile] infont.ttf ...

OPTIONS

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

work essentially like the same options for Perl. If no -e options are provided, the progfile argument specifies the name of a file containing code to be executed. 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. @_ holds the names of the names of the input and optional output font files -- changing $_[0] has no effect, but setting or clearing $_[1] will change the output.

Globbing of file names is permitted:

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

including the output name:

 ttfeval ... -o x*.ttf *.ttf

AUTHOR

Martin Hosken http://scripts.sil.org/FontUtils. (see CONTRIBUTORS for other authors).

LICENSING

Copyright (c) 1998-2014, SIL International (http://www.sil.org)

This script is released under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE.