Bug 13709 - Patron cards creator utf-8 encoding and ttf fonts broken
This change is similar to Bug 8375 which introduced ttf fonts for
labels printing in order to support diacritics and utf-8 encoding,
but this change was never implemented for patron cards.
Test scenario:
1. make sure that you have <ttf> font mapping in koha-conf.xml
2. define partron card layout, template, profile and batch
(with utf-8 chars, probably in patron firstname or surname)
3. verify that without this patch pdf export file is error message
Wide character in compress at /usr/share/perl5/PDF/Reuse.pm line 820
4. apply this patch and verify that generated pdf has correct encoding
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d149cd1d97)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
This commit is contained in:
parent
5168af2c23
commit
ab60b4a60b
|
|
@ -173,13 +173,10 @@ sub draw_text {
|
|||
}
|
||||
box ($origin_llx, $box_lly, $self->{'width'} - $text_attribs->{'llx'}, $box_height, $pdf);
|
||||
}
|
||||
# my $font_resource = $pdf->TTFont("/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf");
|
||||
# $pdf->FontSize($text_attribs->{'font_size'});
|
||||
my $font_resource = $pdf->Font($text_attribs->{'font'});
|
||||
$pdf->Font($text_attribs->{'font'});
|
||||
$pdf->FontSize($text_attribs->{'font_size'});
|
||||
foreach my $line (@lines) {
|
||||
# $pdf->Text($line->{'Tx'}, $line->{'Ty'}, $line->{'line'});
|
||||
my $text_line = "BT /$font_resource $text_attribs->{'font_size'} Tf $line->{'Tx'} $line->{'Ty'} Td $line->{'Tw'} Tw ($line->{'line'}) Tj ET";
|
||||
$pdf->Add($text_line);
|
||||
$pdf->Text($line->{'Tx'}, $line->{'Ty'}, $line->{'line'});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue