Font/TTF/Fpgm.pm

filter: Statementstmt 40.7% 11 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 3 / 3 totaltotal 45.9% 17 / 37 CC 2 SCAR 10.4
CC
2
Cov
38%
XML_end
6.0
out_xml
2.0
BEGIN
1.0
CRAP 2.8
« Font/TTF/LTSH.pm ↑ Summary Font/TTF/Kern/CompactClassArray.pm »
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 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use vars qw(@ISA $VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 @ISA = qw(Font::TTF::Table);
18  
19 1 $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 2 ▶{
Subroutine read: called CC=1 SCAR=0.0
Pod documented
30 2 $_[0]->read_dat;
31 2 $_[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 0 ▶{
Subroutine out_xml: not called CC=1 SCAR=6.9
Pod documented
42 0 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<code>\n");
50 0 $fh->print("$depth$context->{'indent'}$dat");
51 0 $fh->print("$depth</code>\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 0 ▶{
Subroutine XML_end: not called CC=2 SCAR=17.9
Pod documented
64 0 my ($self) = shift;
65 0 my ($context, $tag, %attrs) = @_;
66  
67 0 ▶ if ($tag eq 'code')
Branch: 1 branch
BranchTrueFalseTotal
if ($tag eq 'code') { } 0 0 0
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 1;
76  
77 =head1 BUGS
78  
79 None known
80  
81 =head1 AUTHOR
82  
83 Martin Hosken L<http://scripts.sil.org/FontUtils>.
84  
85  
86 =head1 LICENSING
87  
88 Copyright (c) 1998-2016, 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  
« Font/TTF/LTSH.pm ↑ Summary Font/TTF/Kern/CompactClassArray.pm »