Bugzilla – Attachment 26906 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 2 - Fix label justification/aligning
Bug-8375---Followup-2---Fix-label-justificationali.patch (text/plain), 3.90 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-09 00:57:28 UTC
(
hide
)
Description:
Bug 8375 - Followup 2 - Fix label justification/aligning
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-09 00:57:28 UTC
Size:
3.90 KB
patch
obsolete
>From 5c9cd1031a991e317af87664987cc82e00636d59 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Tue, 8 Apr 2014 21:35:56 -0300 >Subject: [PATCH] Bug 8375 - Followup 2 - Fix label justification/aligning > >This patch use prText alignment to produce center or right >align in text > >To test (with former patches applied): >1. Try a batch of mixed scripts with layout alignment center or right, only latin scripts align almost correctly. >I would suggest to use Helvetica > >2. Apply the patch > >3. Verify again, now strings must be correctly aligned >--- > labels/label-create-pdf.pl | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > >diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl >index 3976d4e..05fde1a 100755 >--- a/labels/label-create-pdf.pl >+++ b/labels/label-create-pdf.pl >@@ -90,7 +90,17 @@ sub _print_text { > foreach my $text_line (@$label_text) { > $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