| 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 1998. <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: Fpgm.pm,v 2.0 2005/11/16 02:16:00 areibens Exp $ | ||
| 25 | # | ||
| 26 | #======================================================================= | ||
| 27 | package PDF::API3::Compat::API2::Basic::TTF::Fpgm; | ||
| 28 | |||
| 29 | =head1 NAME | ||
| 30 | |||
| 31 | PDF::API3::Compat::API2::Basic::TTF::Fpgm - Font program in a TrueType font. Called when a font is loaded | ||
| 32 | |||
| 33 | =head1 DESCRIPTION | ||
| 34 | |||
| 35 | This is a minimal class adding nothing beyond a table, but is a repository | ||
| 36 | for fpgm type information for those processes brave enough to address hinting. | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||
| 40 | use strict; | ||
| 41 | use vars qw(@ISA $VERSION); | ||
| 42 | |||
| 43 | @ISA = qw(PDF::API3::Compat::API2::Basic::TTF::Table); | ||
| 44 | |||
| 45 | $VERSION = 0.0001; | ||
| 46 | |||
| 47 | =head2 $t->read | ||
| 48 | |||
| 49 | Reading this table is simply a process of reading all the data into the RAM | ||
| 50 | copy. Nothing more is done with it. | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | sub read | ||
| 55 | { | ||
| 56 | $_[0]->read_dat; | ||
| 57 | $_[0]->{' read'} = 1; | ||
| 58 | } | ||
| 59 | |||
| 60 | =head2 $t->out_xml($context, $depth) | ||
| 61 | |||
| 62 | Outputs Fpgm program as XML | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | sub out_xml | ||
| 67 | { | ||
| 68 | my ($self, $context, $depth) = @_; | ||
| 69 | my ($fh) = $context->{'fh'}; | ||
| 70 | my ($dat); | ||
| 71 | |||
| 72 | $self->read; | ||
| 73 | $dat = PDF::API3::Compat::API2::Basic::TTF::Utils::XML_binhint($self->{' dat'}); | ||
| 74 | $dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/omg; | ||
| 75 | $fh->print("$depth<code>\n"); | ||
| 76 | $fh->print("$depth$context->{'indent'}$dat"); | ||
| 77 | $fh->print("$depth</code>\n"); | ||
| 78 | $self; | ||
| 79 | } | ||
| 80 | |||
| 81 | |||
| 82 | =head2 $t->XML_end($context, $tag, %attrs) | ||
| 83 | |||
| 84 | Parse all that hinting code | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | sub XML_end | ||
| 89 | { | ||
| 90 | my ($self) = shift; | ||
| 91 | my ($context, $tag, %attrs) = @_; | ||
| 92 | |||
| 93 | if ($tag eq 'code') | ||
| 94 | { | ||
| 95 | $self->{' dat'} = PDF::API3::Compat::API2::Basic::TTF::Utils::XML_hintbin($context->{'text'}); | ||
| 96 | return $context; | ||
| 97 | } else | ||
| 98 | { return $self->SUPER::XML_end(@_); } | ||
| 99 | } | ||
| 100 | |||
| 101 | 1; | ||
| 102 | |||
| 103 | =head1 BUGS | ||
| 104 | |||
| 105 | None known | ||
| 106 | |||
| 107 | =head1 AUTHOR | ||
| 108 | |||
| 109 | Martin Hosken Martin_Hosken@sil.org. See L<PDF::API3::Compat::API2::Basic::TTF::Font> for copyright and | ||
| 110 | licensing. | ||
| 111 | |||
| 112 | =cut | ||
| 113 |