File: ttfcopy.t

package info (click to toggle)
libfont-ttf-perl 1.06-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,144 kB
  • sloc: perl: 17,929; makefile: 10
file content (25 lines) | stat: -rwxr-xr-x 638 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl

use Test::Simple tests => 4;
use File::Compare;
use Font::TTF::Font;

$f = Font::TTF::Font->open("t/testfont.ttf");
ok($f);
$f->tables_do(sub { $_[0]->read; });
$f->{'loca'}->glyphs_do(sub {$_[0]->read_dat; });
$f->out("t/temp.ttf");
$res = compare("t/temp.ttf", "t/testfont.ttf");
ok(!$res);
unlink "t/temp.ttf" unless ($res);

# same test with WOFF input:
$f = Font::TTF::Font->open("t/testfont.woff");
ok($f);
$f->tables_do(sub { $_[0]->read; });
$f->{'loca'}->glyphs_do(sub {$_[0]->read_dat; });
$f->out("t/temp2.ttf");
$res = compare("t/temp2.ttf", "t/testfont.ttf");
ok(!$res);
unlink "t/temp2.ttf" unless ($res);