Found it ....
in the PDF/API2/Resource/Font/CoreFont/courier.pm file I changed
'fontname' => 'Courier',
to
'fontname' => 'Courier-New',
and I added -New, in the other three courier-related files
'fontname' => 'Courier-New,Oblique',
'fontname' => 'Courier-New,Bold',
'fontname' => 'Courier-New,BoldOblique',
and now all is right with the world!
======================%< snip >%================================I'm wondering if it is just me ...
I recently had need for the Courier font in some PDF output. I have been trying to use the corefonts in PDF::API2 but can't seem to get anything other than Courier-Oblique for output. The other corefonts seem to render fine. Here is a mini test program:
#!/usr/bin/perl use strict; use warnings; use PDF::API2; my @fonts = qw( Courier Courier-Bold Courier-BoldOblique Courier-Oblique Verdana Times Times-BoldItalic Georgia Georgia-Bold ); my $pdf = PDF::API2->new; my $page = $pdf->page; my $text = $page->text; my $y = 700; $text->translate( 100, $y ); foreach my $f (@fonts) { my $cft = $pdf->corefont($f); $text->font( $cft, 12 ); $text->text($f); $y -= 15; $text->translate( 100, $y ); } $pdf->saveas('pdftest.pdf'); $pdf->end();
I have tested this on a couple of my Linux boxes and always get the same result -- four lines of Courier-Oblique on the top. Any ideas where I might be going wrong?
Thanks, Robert M.
In reply to [SOLVED] PDF::API2 and the Elusive Courier Font by rsmeineke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |