line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Font::TTF::Prep; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Font::TTF::Prep - Preparation hinting program. Called when ppem changes |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
This is a minimal class adding nothing beyond a table, but is a repository |
10
|
|
|
|
|
|
|
for prep type information for those processes brave enough to address hinting. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
15
|
1
|
|
|
1
|
|
3
|
use vars qw(@ISA $VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
16
|
1
|
|
|
1
|
|
4
|
use Font::TTF::Utils; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
264
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
@ISA = qw(Font::TTF::Table); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$VERSION = 0.0001; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 $t->read |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Reads the data using C. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub read |
30
|
|
|
|
|
|
|
{ |
31
|
2
|
|
|
2
|
1
|
23
|
$_[0]->read_dat; |
32
|
2
|
|
|
|
|
8
|
$_[0]->{' read'} = 1; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 $t->out_xml($context, $depth) |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Outputs Prep program as XML |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub out_xml |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
0
|
1
|
|
my ($self, $context, $depth) = @_; |
45
|
0
|
|
|
|
|
|
my ($fh) = $context->{'fh'}; |
46
|
0
|
|
|
|
|
|
my ($dat); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$self->read; |
49
|
0
|
|
|
|
|
|
$dat = Font::TTF::Utils::XML_binhint($self->{' dat'}); |
50
|
0
|
|
|
|
|
|
$dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/omg; |
51
|
0
|
|
|
|
|
|
$fh->print("$depth\n"); |
52
|
0
|
|
|
|
|
|
$fh->print("$depth$context->{'indent'}$dat"); |
53
|
0
|
|
|
|
|
|
$fh->print("$depth\n"); |
54
|
0
|
|
|
|
|
|
$self; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 $t->XML_end($context, $tag, %attrs) |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Parse all that hinting code |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub XML_end |
65
|
|
|
|
|
|
|
{ |
66
|
0
|
|
|
0
|
1
|
|
my ($self) = shift; |
67
|
0
|
|
|
|
|
|
my ($context, $tag, %attrs) = @_; |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
if ($tag eq 'code') |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
|
|
|
$self->{' dat'} = Font::TTF::Utils::XML_hintbin($context->{'text'}); |
72
|
0
|
|
|
|
|
|
return $context; |
73
|
|
|
|
|
|
|
} else |
74
|
0
|
|
|
|
|
|
{ return $self->SUPER::XML_end(@_); } |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 BUGS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
None known |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Martin Hosken L. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 LICENSING |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Copyright (c) 1998-2014, SIL International (http://www.sil.org) |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This module is released under the terms of the Artistic License 2.0. |
93
|
|
|
|
|
|
|
For details, see the full text of the license in the file LICENSE. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|