1 package Font::TTF::Mort::Rearrangement;
5 Font::TTF::Mort::Rearrangement - Rearrangement Mort subtable for AAT
14 use Font::TTF::AATutils;
16 @ISA = qw(Font::TTF::Mort::Subtable);
20 my ($class, $direction, $orientation, $subFeatureFlags) = @_;
22 'direction' => $direction,
23 'orientation' => $orientation,
24 'subFeatureFlags' => $subFeatureFlags
27 $class = ref($class) || $class;
33 Reads the table into memory
41 my ($classes, $states) = AAT_read_state_table($fh, 0);
42 $self->{'classes'} = $classes;
43 $self->{'states'} = $states;
56 return AAT_pack_state_table($self->{'classes'}, $self->{'states'}, 0);
61 Prints a human-readable representation of the table
69 my $post = $self->post();
71 $fh = 'STDOUT' unless defined $fh;
73 $self->print_classes($fh);
76 my $states = $self->{'states'};
77 my @verbs = ( "0", "Ax->xA", "xD->Dx", "AxD->DxA",
78 "ABx->xAB", "ABx->xBA", "xCD->CDx", "xCD->DCx",
79 "AxCD->CDxA", "AxCD->DCxA", "ABxD->DxAB", "ABxD->DxBA",
80 "ABxCD->CDxAB", "ABxCD->CDxBA", "ABxCD->DCxAB", "ABxCD->DCxBA");
81 foreach (0 .. $#$states) {
82 $fh->printf("\t\tState %d:", $_);
83 my $state = $states->[$_];
86 $flags .= "!" if ($_->{'flags'} & 0x4000);
87 $flags .= "<" if ($_->{'flags'} & 0x8000);
88 $flags .= ">" if ($_->{'flags'} & 0x2000);
89 $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, $verbs[($_->{'flags'} & 0x000f)]);
103 Jonathan Kew L<Jonathan_Kew@sil.org>. See L<Font::TTF::Font> for copyright and