View | Details | Raw Unified | Return to bug 8375
Collapse All | Expand All

(-)a/C4/Creators/PDF.pm (-2 / +13 lines)
Lines 22-27 use warnings; Link Here
22
use PDF::Reuse;
22
use PDF::Reuse;
23
use PDF::Reuse::Barcode;
23
use PDF::Reuse::Barcode;
24
use File::Temp;
24
use File::Temp;
25
use List::Util qw/first/;
25
26
26
BEGIN {
27
BEGIN {
27
    use version; our $VERSION = qv('3.07.00.049');
28
    use version; our $VERSION = qv('3.07.00.049');
Lines 55-62 sub new { Link Here
55
56
56
sub End {
57
sub End {
57
    my $self = shift;
58
    my $self = shift;
58
    # if the pdf stream is utf8, explicitly set it to utf8; this avoids at lease some wide character errors -chris_n
59
59
    utf8::encode($PDF::Reuse::stream) if utf8::is_utf8($PDF::Reuse::stream);
60
    prEnd();
60
    prEnd();
61
61
62
    # slurp temporary filename and print it out for plack to pick up
62
    # slurp temporary filename and print it out for plack to pick up
Lines 112-117 sub Field { Link Here
112
sub Font {
112
sub Font {
113
    my $self = shift;
113
    my $self = shift;
114
    my $fontName = shift;
114
    my $fontName = shift;
115
116
    my $ttf = C4::Context->config('ttf');
117
118
    if ( $ttf ) {
119
        my $ttf_path = first { $_->{type} eq $fontName } @{ $ttf->{font} };
120
        if ( -e $ttf_path->{content} ) {
121
            return prTTFont($ttf_path->{content});
122
        } else {
123
            warn "ERROR in koha-conf.xml -- missing <font type=\"$fontName\">/path/to/font.ttf</font>";
124
        }
125
    }
115
    return prFont($fontName);
126
    return prFont($fontName);
116
}
127
}
117
128
(-)a/etc/koha-conf.xml (+16 lines)
Lines 297-301 __PAZPAR2_TOGGLE_XML_POST__ Link Here
297
 <zebra_bib_index_mode>__BIB_INDEX_MODE__</zebra_bib_index_mode>
297
 <zebra_bib_index_mode>__BIB_INDEX_MODE__</zebra_bib_index_mode>
298
 <zebra_auth_index_mode>__AUTH_INDEX_MODE__</zebra_auth_index_mode>
298
 <zebra_auth_index_mode>__AUTH_INDEX_MODE__</zebra_auth_index_mode>
299
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
299
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
300
301
 <!-- true type font mapping accoding to type from $font_types in C4/Creators/Lib.pm -->
302
 <ttf>
303
    <font type="TR" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf</font>
304
    <font type="TB" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf</font>
305
    <font type="TI" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Italic.ttf</font>
306
    <font type="TBI">/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-BoldItalic.ttf</font>
307
    <font type="C"  >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf</font>
308
    <font type="CB" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf</font>
309
    <font type="CO" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf</font>
310
    <font type="CBO">/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf</font>
311
    <font type="H"  >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf</font>
312
    <font type="HB" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf</font>
313
    <font type="HBO">/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf</font>
314
 </ttf>
315
300
</config>
316
</config>
301
</yazgfs>
317
</yazgfs>
(-)a/labels/label-create-pdf.pl (-5 / +3 lines)
Lines 88-97 sub _calc_next_label_pos { Link Here
88
sub _print_text {
88
sub _print_text {
89
    my $label_text = shift;
89
    my $label_text = shift;
90
    foreach my $text_line (@$label_text) {
90
    foreach my $text_line (@$label_text) {
91
        my $pdf_font = $pdf->Font($text_line->{'font'});
91
        $pdf->Font($text_line->{'font'});
92
        my $line = "BT /$pdf_font $text_line->{'font_size'} Tf $text_line->{'text_llx'} $text_line->{'text_lly'} Td ($text_line->{'line'}) Tj ET";
92
        $pdf->FontSize( $text_line->{'font_size'} );
93
    utf8::decode($line);
93
        $pdf->Text( $text_line->{'text_llx'}, $text_line->{'text_lly'}, $text_line->{'line'} );
94
        $pdf->Add($line);
95
    }
94
    }
96
}
95
}
97
96
98
- 

Return to bug 8375