| 1 | #======================================================================= | ||
| 2 | # ____ ____ _____ _ ____ ___ ____ | ||
| 3 | # | _ \| _ \| ___| _ _ / \ | _ \_ _| |___ \ | ||
| 4 | # | |_) | | | | |_ (_) (_) / _ \ | |_) | | __) | | ||
| 5 | # | __/| |_| | _| _ _ / ___ \| __/| | / __/ | ||
| 6 | # |_| |____/|_| (_) (_) /_/ \_\_| |___| |_____| | ||
| 7 | # | ||
| 8 | # A Perl Module Chain to faciliate the Creation and Modification | ||
| 9 | # of High-Quality "Portable Document Format (PDF)" Files. | ||
| 10 | # | ||
| 11 | #======================================================================= | ||
| 12 | # | ||
| 13 | # THIS IS A REUSED PERL MODULE, FOR PROPER LICENCING TERMS SEE BELOW: | ||
| 14 | # | ||
| 15 | # | ||
| 16 | # Copyright Martin Hosken <Martin_Hosken@sil.org> | ||
| 17 | # | ||
| 18 | # No warranty or expression of effectiveness, least of all regarding | ||
| 19 | # anyone's safety, is implied in this software or documentation. | ||
| 20 | # | ||
| 21 | # This specific module is licensed under the Perl Artistic License. | ||
| 22 | # | ||
| 23 | # | ||
| 24 | # $Id: Cvt_.pm,v 2.0 2005/11/16 02:16:00 areibens Exp $ | ||
| 25 | # | ||
| 26 | #======================================================================= | ||
| 27 | package PDF::API3::Compat::API2::Basic::TTF::Cvt_; | ||
| 28 | |||
| 29 | =head1 NAME | ||
| 30 | |||
| 31 | PDF::API3::Compat::API2::Basic::TTF::Cvt_ - Control Value Table in a TrueType font | ||
| 32 | |||
| 33 | =head1 DESCRIPTION | ||
| 34 | |||
| 35 | This is a minimal class adding nothing beyond a table, but is a repository | ||
| 36 | for cvt type information for those processes brave enough to address hinting. | ||
| 37 | |||
| 38 | =head1 INSTANCE VARIABLES | ||
| 39 | |||
| 40 | =over 4 | ||
| 41 | |||
| 42 | =item val | ||
| 43 | |||
| 44 | This is an array of CVT values. Thus access to the CVT is via: | ||
| 45 | |||
| 46 | $f->{'cvt_'}{'val'}[$num]; | ||
| 47 | |||
| 48 | =back | ||
| 49 | |||
| 50 | =head1 METHODS | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | use strict; | ||
| 55 | use vars qw(@ISA $VERSION); | ||
| 56 | use PDF::API3::Compat::API2::Basic::TTF::Utils; | ||
| 57 | |||
| 58 | @ISA = qw(PDF::API3::Compat::API2::Basic::TTF::Table); | ||
| 59 | |||
| 60 | $VERSION = 0.0001; | ||
| 61 | |||
| 62 | =head2 $t->read | ||
| 63 | |||
| 64 | Reads the CVT table into both the tables C<' dat'> variable and the C<val> | ||
| 65 | array. | ||
| 66 | |||
| 67 | =cut | ||
| 68 | |||
| 69 | sub read | ||
| 70 | { | ||
| 71 | my ($self) = @_; | ||
| 72 | |||
| 73 | $self->read_dat || return undef; | ||
| 74 | $self->{' read'} = 1; | ||
| 75 | $self->{'val'} = [TTF_Unpack("s*", $self->{' dat'})]; | ||
| 76 | $self; | ||
| 77 | } | ||
| 78 | |||
| 79 | |||
| 80 | =head2 $t->update | ||
| 81 | |||
| 82 | Updates the RAM file copy C<' dat'> to be the same as the array. | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | sub update | ||
| 87 | { | ||
| 88 | my ($self) = @_; | ||
| 89 | |||
| 90 | return undef unless ($self->{' read'} && $#{$self->{'val'}} >= 0); | ||
| 91 | $self->{' dat'} = TTF_Pack("s*", @{$self->{'val'}}); | ||
| 92 | $self; | ||
| 93 | } | ||
| 94 | |||
| 95 | 1; | ||
| 96 | |||
| 97 | =head1 BUGS | ||
| 98 | |||
| 99 | None known | ||
| 100 | |||
| 101 | =head1 AUTHOR | ||
| 102 | |||
| 103 | Martin Hosken Martin_Hosken@sil.org. See L<PDF::API3::Compat::API2::Basic::TTF::Font> for copyright and | ||
| 104 | licensing. | ||
| 105 | |||
| 106 | =cut | ||
| 107 |