Subject: | Characterspacing in Truetype-Fonts broken |
I tried to put some text with a truetype-font on a pdf-document via
PDF::API2. Now, the character spacing seems to be broken.
The $cfont-object, despite its name here is the PDF::API2-TTF-Font-Object.
I wrote the text with the following code:
my $dev=$self->pdfDevice;
$dev->save();
$dev->textstart();
$dev->fillcolor($font->fontColor);
$dev->font($cfont,$font->fontSize);
my %trans_opts=( -translate => [$x,$y+$off] );
$dev->transform(%trans_opts);
$dev->text($text);
$dev->textend();
$dev->restore();
The spacing between the characters is much too wide.
In addition to that, calculating the size of a string with
my $width=$cfont->width($text)
also seems to give wrong values.
You can see the problems in the given document:
The Truetype fonts are the three last ones in section 1.1.1
I run perl at a kubuntu dapper drake linux, tried it with the PDF::API2
of the distribution and with a fresh one from CPAN.
My perl is a v5.8.7
Christian
Subject: | WiKi_Wiki_FeatureTest(2).pdf |
Message body not shown because it is not plain text.