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

(-)a/C4/Creators/PDF.pm (-3 / +8 lines)
Lines 55-62 sub new { Link Here
55
55
56
sub End {
56
sub End {
57
    my $self = shift;
57
    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
58
59
    utf8::encode($PDF::Reuse::stream) if utf8::is_utf8($PDF::Reuse::stream);
60
    prEnd();
59
    prEnd();
61
60
62
    # slurp temporary filename and print it out for plack to pick up
61
    # slurp temporary filename and print it out for plack to pick up
Lines 112-118 sub Field { Link Here
112
sub Font {
111
sub Font {
113
    my $self = shift;
112
    my $self = shift;
114
    my $fontName = shift;
113
    my $fontName = shift;
115
    return prFont($fontName);
114
    my $ttf_path = '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf';
115
    if ( -e $ttf_path ) {
116
	warn "# using ttf_path $ttf_path";
117
        return prTTFont($ttf_path);
118
    } else {
119
        return prFont($fontName);
120
    }
116
}
121
}
117
122
118
sub FontSize {
123
sub FontSize {
(-)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