use File::Temp;
use List::Util qw/first/;
-BEGIN {
- use version; our $VERSION = qv('3.07.00.049');
-}
sub _InitVars {
my $self = shift;
my $self = shift;
my ($string, $font, $fontSize) = @_;
- # replace font code with path to TTF font file if need be
- my $ttf = C4::Context->config('ttf');
- if ( $ttf ) {
- my $ttf_path = first { $_->{type} eq $font } @{ $ttf->{font} };
- if ( -e $ttf_path->{content} ) {
- $font = $ttf_path->{content};
- } else {
- warn "ERROR in koha-conf.xml -- missing <font type=\"$font\">/path/to/font.ttf</font>";
- }
- }
+ # replace font code with correct internal font
+ $font = C4::Creators::PDF->Font($font);
return prStrWidth($string, $font, $fontSize);
}
=head1 NAME
-C4::Creators::PDF - A class wrapper for PDF::Reuse and PDF::Reuse::Barcode to allow usage as a psuedo-object. For usage see
+C4::Creators::PDF - A class wrapper for PDF::Reuse and PDF::Reuse::Barcode to allow usage as a pseudo-object. For usage see
PDF::Reuse documentation and C4::Creators::PDF code.
=cut