Bug 17981: Add a 'letter' param to GetPreparedLetter
[koha.git] / C4 / Creators / PDF.pm
index 7dde9ee..9796feb 100644 (file)
@@ -24,9 +24,6 @@ use PDF::Reuse::Barcode;
 use File::Temp;
 use List::Util qw/first/;
 
-BEGIN {
-    use version; our $VERSION = qv('3.07.00.049');
-}
 
 sub _InitVars {
     my $self = shift;
@@ -219,16 +216,8 @@ sub StrWidth {
     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);
 }
@@ -323,7 +312,7 @@ __END__
 
 =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