/usr/share/perl5/Font/TTF/DSIG.pm is in libfont-ttf-perl 1.04-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | package Font::TTF::DSIG;
use strict;
use vars qw(@ISA);
require Font::TTF::Table;
use Font::TTF::Utils;
@ISA = qw(Font::TTF::Table);
sub create
{
my ($class) = @_;
my ($self) = { 'version' => 1, 'numtables' => 0, 'perms' => 0 };
bless $self, ref $class || $class;
return $self;
}
sub read
{
my ($self) = @_;
my ($dat, $i, @records, $r);
$self->SUPER::read || return $self;
$self->{' INFILE'}->read($dat, 8);
($self->{'version'}, $self->{'numtables'}, $self->{'perms'}) = unpack("LNN", $dat);
for ($i = 0; $i < $self->{'numtables'}; $i++)
{
$self->{' INFILE'}->read($dat, 12);
push (@records, [unpack("L3", $dat)]);
}
foreach $r (@records)
{
if ($r->[0] == 1)
{
$self->{' INFILE'}->seek($self->{' OFFSET'} + $r->[2]);
$self->{' INFILE'}->read($dat, $r->[1]);
push @{$self->{'records'}}, substr($dat, 8);
}
}
$self;
}
sub out
{
my ($self, $fh) = @_;
my ($i, $curlen);
return $self->SUPER::out($fh) unless $self->{' read'}; # this is never true
$fh->print(pack("LNN", $self->{'version'}, $self->{'numtables'}, $self->{'perms'}));
$curlen = 0;
for ($i = 0; $i < $self->{'numtables'}; $i++)
{
$fh->print(pack("L3", 1, length($self->{'records'}[$i]) + 8, $curlen + $self->{'numtables'} * 12 + 8));
$curlen += length($self->{'records'}[$i]) + 8;
}
for ($i = 0; $i < $self->{'numtables'}; $i++)
{
$fh->print(pack("NNL", 0, 0, length($self->{'records'}[$i])));
$fh->print($self->{'records'}[$i]);
}
$self;
}
1;
=head1 AUTHOR
Martin Hosken L<Martin_Hosken@sil.org>.
=head1 LICENSING
Copyright (c) 1998-2013, SIL International (http://www.sil.org)
This module is released under the terms of the Artistic License 2.0.
For details, see the full text of the license in the file LICENSE.
=cut
|