Bugzilla – Attachment 27482 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]
[SIGNED-OFF] Bug 8375 - Followup - Fix font code and alignment
SIGNED-OFF-Bug-8375---Followup---Fix-font-code-and.patch (text/plain), 3.90 KB, created by
Chris Nighswonger
on 2014-04-23 13:55:17 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 8375 - Followup - Fix font code and alignment
Filename:
MIME Type:
Creator:
Chris Nighswonger
Created:
2014-04-23 13:55:17 UTC
Size:
3.90 KB
patch
obsolete
>From ce09e7bb361a965548c63fa6a6d830454b78293e Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Sun, 20 Apr 2014 20:23:51 -0300 >Subject: [PATCH] [SIGNED-OFF] Bug 8375 - Followup - Fix font code and > alignment > >This patch fixes two problems: >a) Bad PDF when using Helvetica font. >Current label code assigns 'italic' or 'oblique' variants >to title. Helvetica-Oblique was not defined, but is present > >b) Bad alignment using center/right justification >Problem was bad font parameter passed to StrWidth >routine > >To test: >1. Try making a batch using Helvetica, 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 and update your koha-conf.xml to add Oblique variant >4. Try again 1, now PDF opens >5. Try 2, now alignment is correct > >New problem (for another bug): DejaVuSans has a good >support for arabic, but not Oblique variant. As selection >of italic/oblique is hardcoded, now Arabic titles are >not displayed. I'll try to add a checkbox to select >or not this feature. > >Added a FIXME for the hardcoded forced oblique -chris_n > >Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu> >--- > C4/Creators/Lib.pm | 1 + > C4/Labels/Label.pm | 4 +++- > etc/koha-conf.xml | 1 + > 3 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm >index 6fa9bf4..c519352 100644 >--- a/C4/Creators/Lib.pm >+++ b/C4/Creators/Lib.pm >@@ -119,6 +119,7 @@ my $font_types = [ > {type => 'CO', name => 'Courier-Oblique', selected => 0}, > {type => 'CBO', name => 'Courier-Bold-Oblique', selected => 0}, > {type => 'H', name => 'Helvetica', selected => 0}, >+ {type => 'HO', name => 'Helvetica-Oblique', selected => 0}, > {type => 'HB', name => 'Helvetica-Bold', selected => 0}, > {type => 'HBO', name => 'Helvetica-Bold-Oblique', selected => 0}, > ]; >diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm >index cb6a631..eb28006 100644 >--- a/C4/Labels/Label.pm >+++ b/C4/Labels/Label.pm >@@ -396,6 +396,7 @@ sub draw_label_text { > else { > $field->{'data'} = _get_barcode_data($field->{'code'},$item,$record); > } >+ #FIXME: We should not force the title to oblique; this should be selectible in the layout configuration > ($field->{'code'} eq 'title') ? (($font =~ /T/) ? ($font = 'TI') : ($font = ($font . 'O'))) : ($font = $font); > my $field_data = $field->{'data'}; > if ($field_data) { >@@ -442,7 +443,8 @@ sub draw_label_text { > LABEL_LINES: # generate lines of label text for current field > foreach my $line (@label_lines) { > next LABEL_LINES if $line eq ''; >- my $string_width = C4::Creators::PDF->StrWidth($line, $font, $self->{'font_size'}); >+ my $fontName = C4::Creators::PDF->Font($font); >+ my $string_width = C4::Creators::PDF->StrWidth($line, $fontName, $self->{'font_size'}); > if ($self->{'justify'} eq 'R') { > $text_llx = $params{'llx'} + $self->{'width'} - ($self->{'left_text_margin'} + $string_width); > } >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 566318e..710deb5 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -311,6 +311,7 @@ __PAZPAR2_TOGGLE_XML_POST__ > <font type="CO" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf</font> > <font type="CBO">/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf</font> > <font type="H" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf</font> >+ <font type="HO" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf</font> > <font type="HB" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf</font> > <font type="HBO">/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf</font> > </ttf> >-- >1.8.3.2
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