9 my ($ttfname, $outfile) = @ARGV;
11 for ($outfile || ()) {
12 !-e $_ or die "Output file $outfile already exists\n";
13 open my $output, '>', $_ or die "Cannot write to $outfile: $!\n";
18 my $ttf = Font::TTF::Font->open($ttfname)
19 or die "Cannot open truetype in $ttfname: $!";
23 name => $ttf->{name}->read->find_name(4) || $ttfname,
24 version => $ttf->{head}->{fontRevision},
28 Time::Piece->new($_)->datetime;
30 } $ttf->{head}->getdate),
34 my $support = $ttf->{cmap}->find_ms->{val};
35 warn scalar keys %$support, " characters read from $ttfname\n";
36 say pp(sort { $a <=> $b } keys %$support);
43 convert-ttf.pl - Writes unicode characters present in TrueType font
47 convert-ttf <font.ttf> [<output.inc.pl>]
51 Mischa POSLAWSKY <perl@shiar.org>
55 Licensed under the GNU Affero General Public License version 3.