PDF-FromHTML
view release on metacpan or search on metacpan
lib/PDF/FromHTML/Template/Container/Font.pm view on Meta::CPAN
use PDF::FromHTML::Template::Container;
}
my @current_font = ();
sub new
{
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->{EMBED} = 0 unless defined $self->{EMBED};
return $self;
}
sub render
{
my $self = shift;
my ($context) = @_;
my $p = $context->{PDF};
lib/PDF/FromHTML/Template/Container/Font.pm view on Meta::CPAN
my $face = $context->get($self, 'FACE') ||
die "Face not set by the time <font> was rendered", $/;
unless ($context->retrieve_font($face))
{
my $encoding = $context->get($self, 'PDF_ENCODING') || 'host';
my $font = $context->{PDF}->find_font(
$face,
$encoding,
$context->get($self, 'EMBED'),
) or die "Font not found for '$face' by the time <font> was rendered", $/;
$context->store_font($face, $font);
}
return $self->SUPER::begin_page($context);
}
1;
__END__
( run in 0.545 second using v1.01-cache-2.11-cpan-71847e10f99 )