|
Packit |
5d935b |
=head1 INTRODUCTION
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Perl module for TrueType/OpenType font hacking. Supports reading, processing and
|
|
Packit |
5d935b |
writing of the following tables: GDEF, GPOS, GSUB, LTSH, OS/2, PCLT,
|
|
Packit |
5d935b |
bsln, cmap, cvt, fdsc, feat, fpgm, glyf, hdmx, head, hhea, hmtx, kern,
|
|
Packit |
5d935b |
loca, maxp, mort, name, post, prep, prop, vhea, vmtx and the reading and
|
|
Packit |
5d935b |
writing of all other table types.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
In short, you can do almost anything with a standard TrueType font with
|
|
Packit |
5d935b |
this module. Be Brave!
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Any suggestions, improvements, additions, subclasses, etc. would be gratefully
|
|
Packit |
5d935b |
received and probably included in a future release. Please send them to me.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
This module has been tested on Win32, Unix and Mac.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Applications that were associated with this module have been moved to
|
|
Packit |
5d935b |
Font::TTF::Scripts where great things can be done.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
=head1 SYNOPSIS
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Here is the regression test (you provide your own font). Run it once and then
|
|
Packit |
5d935b |
again on the output of the first run. There should be no differences between
|
|
Packit |
5d935b |
the outputs of the two runs.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
use Font::TTF::Font;
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
$f = Font::TTF::Font->open($ARGV[0]);
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
# force a read of all the tables
|
|
Packit |
5d935b |
$f->tables_do(sub { $_[0]->read; });
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
# force read of all glyphs (use read_dat to use lots of memory!)
|
|
Packit |
5d935b |
# $f->{'loca'}->glyphs_do(sub { $_[0]->read; });
|
|
Packit |
5d935b |
$f->{'loca'}->glyphs_do(sub { $_[0]->read_dat; });
|
|
Packit |
5d935b |
# NB. no need to $g->update since $_[0]->{'glyf'}->out will do it for us
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
$f->out($ARGV[1]);
|
|
Packit |
5d935b |
$f->DESTROY; # forces close of $in and maybe memory reclaim!
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
=head1 INSTALLATION
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
If you have received this package as part of an Activestate PPM style .zip file
|
|
Packit |
5d935b |
then type
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
ppm install Font-TTF.ppd
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Otherwise.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
To configure this module, cd to the directory that contains this README file
|
|
Packit |
5d935b |
and type the following.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
perl Makefile.PL
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Alternatively, if you plan to install Font::TTF somewhere other than
|
|
Packit |
5d935b |
your system's perl library directory. You can type something like this:
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
perl Makefile.PL PREFIX=/home/me/perl INSTALLDIRS=perl
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Then to build you run make.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
make
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
If you have write access to the perl library directories, you may then
|
|
Packit |
5d935b |
install by typing:
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
make install
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
To tidy up, type:
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
make realclean
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Windows users should use dmake instead of make.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
=head1 CHANGES
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
See Changes for an overview of recent changes.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
=head2 Future Changes
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
I do not anticipate any more restructuring changes (but reserve the right to do so).
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
=head1 AUTHOR
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Martin Hosken L<http://scripts.sil.org/FontUtils>.
|
|
Packit |
5d935b |
(see CONTRIBUTORS for other authors).
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
=head1 LICENSING
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
Copyright (c) 1998-2016, SIL International (http://www.sil.org)
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
This module is released under the terms of the Artistic License 2.0.
|
|
Packit |
5d935b |
For details, see the full text of the license in the file LICENSE.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
The fonts in the test suite are released under the SIL Open Font License 1.1, see t/OFL.txt.
|
|
Packit |
5d935b |
|
|
Packit |
5d935b |
=cut
|