1 package Font::TTF::Kern::OrderedList;
5 Font::TTF::Kern::OrderedList - Ordered List Kern subtable for AAT
14 use Font::TTF::AATutils;
16 @ISA = qw(Font::TTF::Kern::Subtable);
20 my ($class, @options) = @_;
23 $class = ref($class) || $class;
29 Reads the table into memory
39 my ($nPairs, $searchRange, $entrySelector, $rangeShift) = unpack("nnnn", $dat);
42 foreach (1 .. $nPairs) {
44 my ($left, $right, $kern) = TTF_Unpack("SSs", $dat);
45 push @$pairs, { 'left' => $left, 'right' => $right, 'kern' => $kern } if $kern != 0;
48 $self->{'kernPairs'} = $pairs;
53 =head2 $t->out_sub($fh)
55 Writes the table to a file
63 my $pairs = $self->{'kernPairs'};
64 $fh->print(pack("nnnn", TTF_bininfo(scalar @$pairs, 6)));
66 foreach (sort { $a->{'left'} <=> $b->{'left'} or $a->{'right'} <=> $b->{'right'} } @$pairs) {
67 $fh->print(TTF_Pack("SSs", $_->{'left'}, $_->{'right'}, $_->{'kern'}));
73 Prints a human-readable representation of the table
81 my $postVal = $self->post()->{'VAL'};
83 $fh = 'STDOUT' unless defined $fh;
84 foreach (@{$self->{'kernPairs'}}) {
85 $fh->printf("<pair l=\"%s\" r=\"%s\" v=\"%s\"/>\n", $postVal->[$_->{'left'}], $postVal->[$_->{'right'}], $_->{'kern'});
92 return 'kernOrderedList';
104 Jonathan Kew L<Jonathan_Kew@sil.org>. See L<Font::TTF::Font> for copyright and