Bugzilla – Attachment 36558 Details for
Bug 13709
Patron cards creator doesn't work with diacritics, utf-8 or ttf fonts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13709 - Patron cards creator utf-8 encoding and ttf fonts broken
Bug-13709---Patron-cards-creator-utf-8-encoding-an.patch (text/plain), 2.10 KB, created by
Jonathan Druart
on 2015-03-05 11:00:56 UTC
(
hide
)
Description:
Bug 13709 - Patron cards creator utf-8 encoding and ttf fonts broken
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-03-05 11:00:56 UTC
Size:
2.10 KB
patch
obsolete
>From cc81d1cdcfda45bc47df5af442128e56ee6c93b3 Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Fri, 13 Feb 2015 15:37:12 +0100 >Subject: [PATCH] Bug 13709 - Patron cards creator utf-8 encoding and ttf fonts > broken > >This change is similar to Bug 8375 which introduced ttf fonts for >labels printing in order to support diacritics and utf-8 encoding, >but this change was never implemented for patron cards. > >Test scenario: > >1. make sure that you have <ttf> font mapping in koha-conf.xml >2. define partron card layout, template, profile and batch > (with utf-8 chars, probably in patron firstname or surname) >3. verify that without this patch pdf export file is error message > Wide character in compress at /usr/share/perl5/PDF/Reuse.pm line 820 >4. apply this patch and verify that generated pdf has correct encoding > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Patroncards/Patroncard.pm | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > >diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm >index 339b969..f130a04 100644 >--- a/C4/Patroncards/Patroncard.pm >+++ b/C4/Patroncards/Patroncard.pm >@@ -173,13 +173,10 @@ sub draw_text { > } > box ($origin_llx, $box_lly, $self->{'width'} - $text_attribs->{'llx'}, $box_height, $pdf); > } >-# my $font_resource = $pdf->TTFont("/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf"); >-# $pdf->FontSize($text_attribs->{'font_size'}); >- my $font_resource = $pdf->Font($text_attribs->{'font'}); >+ $pdf->Font($text_attribs->{'font'}); >+ $pdf->FontSize($text_attribs->{'font_size'}); > foreach my $line (@lines) { >-# $pdf->Text($line->{'Tx'}, $line->{'Ty'}, $line->{'line'}); >- my $text_line = "BT /$font_resource $text_attribs->{'font_size'} Tf $line->{'Tx'} $line->{'Ty'} Td $line->{'Tw'} Tw ($line->{'line'}) Tj ET"; >- $pdf->Add($text_line); >+ $pdf->Text($line->{'Tx'}, $line->{'Ty'}, $line->{'line'}); > } > } > } >-- >2.1.0
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 13709
:
35906
|
36264
| 36558