Bugzilla – Attachment 26928 Details for
Bug 8375
Common diacritics not shown correctly when exporting batch label to PDF
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8375 - Followup - Fix font code and alignment
Bug-8375---Followup---Fix-font-code-and-alignment.patch (text/plain), 4.09 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-09 17:42:07 UTC
(
hide
)
Description:
Bug 8375 - Followup - Fix font code and alignment
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-09 17:42:07 UTC
Size:
4.09 KB
patch
obsolete
>From 6b35c82f9301ffb9cc8f9b24762c8c50dce304e2 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Tue, 8 Apr 2014 20:55:58 -0300 >Subject: [PATCH] Bug 8375 - Followup - Fix font code and alignment >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This follow up fixes font code taking it from layout, >and alignment. > >To test: >1. Try making a batch using Helvética, downloaded >PDF do not open. >2. Try a batch of mixed scripts with layout alignment center or right, only latin scripts align almost correctly. >3. Apply the patch >4. Try again 1, now PDF opens >5. Try 2, now alignment is correct >--- > labels/label-create-pdf.pl | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > >diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl >index e23b068..05fde1a 100755 >--- a/labels/label-create-pdf.pl >+++ b/labels/label-create-pdf.pl >@@ -88,9 +88,19 @@ sub _calc_next_label_pos { > sub _print_text { > my $label_text = shift; > foreach my $text_line (@$label_text) { >- $pdf->Font($text_line->{'font'}); >+ $pdf->Font($layout->get_attr('font')); > $pdf->FontSize( $text_line->{'font_size'} ); >- $pdf->Text( $text_line->{'text_llx'}, $text_line->{'text_lly'}, $text_line->{'line'} ); >+ my $llx = $text_line->{'text_llx'}; >+ my $align = ''; >+ if ( $layout->get_attr('text_justify') eq 'C' ) { >+ $llx += $template->get_attr('label_width')/2.0; >+ $align = 'center'; >+ } >+ elsif ( $layout->get_attr('text_justify') eq 'R' ) { >+ $llx += $template->get_attr('label_width'); >+ $align = 'right'; >+ } >+ $pdf->Text( $llx, $text_line->{'text_lly'}, $text_line->{'line'}, $align ); > } > } > >@@ -142,7 +152,6 @@ foreach my $item (@{$items}) { > font => $layout->get_attr('font'), > font_size => $layout->get_attr('font_size'), > callnum_split => $layout->get_attr('callnum_split'), >- justify => $layout->get_attr('text_justify'), > format_string => $layout->get_attr('format_string'), > text_wrap_cols => $layout->get_text_wrap_cols(label_width => $template->get_attr('label_width'), left_text_margin => $template->get_attr('left_text_margin')), > ); >@@ -165,7 +174,6 @@ foreach my $item (@{$items}) { > font => $layout->get_attr('font'), > font_size => $layout->get_attr('font_size'), > callnum_split => $layout->get_attr('callnum_split'), >- justify => $layout->get_attr('text_justify'), > format_string => $layout->get_attr('format_string'), > text_wrap_cols => $layout->get_text_wrap_cols(label_width => $template->get_attr('label_width'), left_text_margin => $template->get_attr('left_text_margin')), > ); >@@ -191,7 +199,6 @@ foreach my $item (@{$items}) { > font => $layout->get_attr('font'), > font_size => $layout->get_attr('font_size'), > callnum_split => $layout->get_attr('callnum_split'), >- justify => $layout->get_attr('text_justify'), > format_string => $layout->get_attr('format_string'), > text_wrap_cols => $layout->get_text_wrap_cols(label_width => $template->get_attr('label_width'), left_text_margin => $template->get_attr('left_text_margin')), > ); >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8375
:
10651
|
10652
|
10653
|
10654
|
11031
|
12925
|
16548
|
21458
|
26905
|
26906
|
26907
|
26928
|
26976
|
26977
|
26978
|
27335
|
27363
|
27480
|
27482
|
27483
|
27484
|
27917
|
27918
|
37279
|
37285