Skip Menu |
 

This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id: 126274
Status: resolved
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: fcc_del [...] bc.hu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.034



CC: fcc_del [...] bc.hu
Subject: unifont -indent fails if text is not in multiple block
Date: Tue, 14 Aug 2018 22:51:46 +0200 (CEST)
To: bug-PDF-API2 [...] rt.cpan.org
From: fcc_del [...] bc.hu
Download (untitled) / with headers
text/plain 1.1k
methods: text_center, text_right And at lower level, the value of -indent key and variable $ident does not work properly, if the text can be printed using only one font inside unifont. The attached unierror.pl can demonstrate it. The result is unierror.pdf I'm using debian, perl 5.10.1 (not relevant for the bug) package PDF::API2::Resource::UniFont; our $VERSION = '2.023'; # VERSION The following patch can solve this problem. Patch: --- unifont-old.pm 2014-09-12 00:00:00.000000000 +0200 +++ UniFont.pm 2018-08-14 22:32:16.938551934 +0200 @@ -276,7 +276,15 @@ if(scalar @codes > 0) { my $f=$self->fontlist->[$lastfont]; - $newtext.='/'.$f->name.' '.$size.' Tf '.$f->text(pack('U*',@codes),$size).' '; + if(defined($ident) && $ident!=0) + { + $newtext.='/'.$f->name.' '.$size.' Tf ['.$ident.' '.$f->text(pack('U*',@codes)).'] TJ '; + $ident=undef; + } + else + { + $newtext.='/'.$f->name.' '.$size.' Tf '.$f->text(pack('U*',@codes)).' Tj '; + } } return($newtext); } Thank you for your help
Download unierror.pl
text/x-perl 1.4k

Message body is not shown because sender requested not to inline it.

Download unierror.pdf
application/pdf 26.9k

Message body not shown because it is not plain text.

FYI, this is fixed in PDF::Builder
Download (untitled) / with headers
text/plain 1.4k
Thanks for the bug report! I've incorporated your fix with minor changes, cleaned up the surrounding code, and added a couple of tests. It'll be included in the next release. On Tue Aug 14 17:29:32 2018, fcc_del@bc.hu wrote: Show quoted text
> > methods: text_center, text_right > And at lower level, the value of -indent key and variable $ident does > not work properly, if the text can be printed using only one font > inside > unifont. > > The attached unierror.pl can demonstrate it. The result is > unierror.pdf > > I'm using debian, perl 5.10.1 (not relevant for the bug) > > package PDF::API2::Resource::UniFont; > our $VERSION = '2.023'; # VERSION > > The following patch can solve this problem. > > Patch: > --- unifont-old.pm 2014-09-12 00:00:00.000000000 +0200 > +++ UniFont.pm 2018-08-14 22:32:16.938551934 +0200 > @@ -276,7 +276,15 @@ > if(scalar @codes > 0) > { > my $f=$self->fontlist->[$lastfont]; > - $newtext.='/'.$f->name.' '.$size.' Tf '.$f-
> >text(pack('U*',@codes),$size).' ';
> + if(defined($ident) && $ident!=0) > + { > + $newtext.='/'.$f->name.' '.$size.' Tf ['.$ident.' '.$f-
> >text(pack('U*',@codes)).'] TJ ';
> + $ident=undef; > + } > + else > + { > + $newtext.='/'.$f->name.' '.$size.' Tf '.$f-
> >text(pack('U*',@codes)).' Tj ';
> + } > } > > return($newtext); > } > > > Thank you for your help
Download (untitled) / with headers
text/plain 616b
On Thu May 16 21:47:24 2019, SSIMMS wrote: Show quoted text
> Thanks for the bug report! > > I've incorporated your fix with minor changes, cleaned up the > surrounding code, and added a couple of tests. It'll be included in > the next release. > > > On Tue Aug 14 17:29:32 2018, fcc_del@bc.hu wrote: >
Steve, you may want to read https://github.com/PhilterPaper/Perl-PDF-Builder/issues/96. The fix (missing parameter to text() call) is much simpler than the suggested one. I will look at your changes to see if there's anything I overlooked. I see you have made other changes in this group that may be of interest for Builder.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.