Bug 14468: Remove warnings when creating Labels
[srvgit] / C4 / Creators / PDF.pm
index dd0d3f6..e0c8847 100644 (file)
@@ -219,16 +219,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);
 }