Introduce src dir.
[librarian.git] / src / librarian / font-optimizer / ext / Font-TTF / t / ttfcopy.t
diff --git a/src/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t b/src/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t
new file mode 100644 (file)
index 0000000..c8969b3
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+
+use Test::Simple tests => 2;
+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);
+