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