Tue Aug 14 17:29:32 2018 fcc_del [...] bc.hu - Ticket created
Subject: unifont -indent fails if text is not in multiple block
Date: Tue, 14 Aug 2018 22:51:46 +0200 (CEST)
From: fcc_del [...] bc.hu
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