line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Font::TTF::Cvt_; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Font::TTF::Cvt_ - Control Value Table in a TrueType font |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
This is a minimal class adding nothing beyond a table, but is a repository |
10
|
|
|
|
|
|
|
for cvt type information for those processes brave enough to address hinting. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 INSTANCE VARIABLES |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=over 4 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=item val |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This is an array of CVT values. Thus access to the CVT is via: |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$f->{'cvt_'}{'val'}[$num]; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=back |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 METHODS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
29
|
1
|
|
|
1
|
|
5
|
use vars qw(@ISA $VERSION); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
30
|
1
|
|
|
1
|
|
3
|
use Font::TTF::Utils; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
179
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
@ISA = qw(Font::TTF::Table); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$VERSION = 0.0001; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 $t->read |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Reads the CVT table into both the tables C<' dat'> variable and the C |
39
|
|
|
|
|
|
|
array. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub read |
44
|
|
|
|
|
|
|
{ |
45
|
2
|
|
|
2
|
1
|
16
|
my ($self) = @_; |
46
|
|
|
|
|
|
|
|
47
|
2
|
50
|
|
|
|
126
|
$self->read_dat || return undef; |
48
|
2
|
|
|
|
|
4
|
$self->{' read'} = 1; |
49
|
2
|
|
|
|
|
9
|
$self->{'val'} = [TTF_Unpack("s*", $self->{' dat'})]; |
50
|
2
|
|
|
|
|
7
|
$self; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 $t->update |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Updates the RAM file copy C<' dat'> to be the same as the array. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub update |
61
|
|
|
|
|
|
|
{ |
62
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
63
|
|
|
|
|
|
|
|
64
|
0
|
0
|
0
|
|
|
|
return undef unless ($self->{' read'} && $#{$self->{'val'}} >= 0); |
|
0
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
$self->{' dat'} = TTF_Pack("s*", @{$self->{'val'}}); |
|
0
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
$self; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 BUGS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
None known |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 AUTHOR |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Martin Hosken L. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 LICENSING |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Copyright (c) 1998-2014, SIL International (http://www.sil.org) |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This module is released under the terms of the Artistic License 2.0. |
85
|
|
|
|
|
|
|
For details, see the full text of the license in the file LICENSE. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|