@@ -, +, @@ --- C4/Creators/Layout.pm | 2 +- C4/Creators/PDF.pm | 12 ++---------- C4/Labels/Label.pm | 3 +-- 3 files changed, 4 insertions(+), 13 deletions(-) --- a/C4/Creators/Layout.pm +++ a/C4/Creators/Layout.pm @@ -228,7 +228,7 @@ sub get_text_wrap_cols { my $textlimit = $params{'label_width'} - (( 3 * $params{'left_text_margin'} ) || 13.5 ); while ($strwidth < $textlimit) { - $string .= '0'; + $string .= '8'; # using '8' as filling char instead of '0' $col_count++; $strwidth = C4::Creators::PDF->StrWidth( $string, $self->{'font'}, $self->{'font_size'} ); } --- a/C4/Creators/PDF.pm +++ a/C4/Creators/PDF.pm @@ -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 /path/to/font.ttf"; - } - } + # replace font code with correct internal font + $font = C4::Creators::PDF->Font($font); return prStrWidth($string, $font, $fontSize); } --- a/C4/Labels/Label.pm +++ a/C4/Labels/Label.pm @@ -456,9 +456,8 @@ sub draw_label_text { LABEL_LINES: # generate lines of label text for current field foreach my $line (@label_lines) { next LABEL_LINES if $line eq ''; - my $fontName = C4::Creators::PDF->Font($font); $line = log2vis( $line ); - my $string_width = C4::Creators::PDF->StrWidth($line, $fontName, $self->{'font_size'}); + my $string_width = C4::Creators::PDF->StrWidth($line, $font, $self->{'font_size'}); if ($self->{'justify'} eq 'R') { $text_llx = $params{'llx'} + $self->{'width'} - ($self->{'left_text_margin'} + $string_width); } --