Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.3

Bug #9595 Font file typos
Submitted: 2006-12-11 01:14 UTC
From: atex at php dot net Assigned: yunosh
Status: Closed Package: File_PDF (version 0.1.0)
PHP Version: 5.2.0 RC4 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-12-11 01:14 UTC] atex at php dot net (Andrew Teixeira)
Description: ------------ When trying to use the getStringWidth() method on a string with a ',' (comma) in it, I sometimes get the following error: Notice: Undefined index: , in /usr/lib/php/File/PDF.php on line 1127 It seems that the ',' character's width cannot be determined. Test script: --------------- I have tried to use the following test script: error_reporting(E_ALL); require_once 'File/PDF.php'; $options = array('orientation' => 'P', 'unit' => 'pt', 'format' => 'Letter'); $pdf =& File_PDF::factory($options); $pdf->addPage(); $pdf->aliasNbPages(); $text = 'hello, goodbye, hello again'; $size = $pdf->getStringWidth($text); $pdf->setFont('Times', NULL, 12); $pdf->cell($size, 0, $text, 'R', 0, 'L', 0); $pdf_len = strlen($pdf->getOutput()); header('Cache-Control: no-cache'); header('Pragma: no-cache'); header("Content-Length: " . pdf_len); $pdf->output('file_pdf_test.pdf', true); However, I cannot force the error to appear. The problem, however, appears to come from the fact that the ',' entry in the arrays in the php files in the fonts/ directory for many of the fonts are as follows: ', ' => 250, The line-break and indentation seem to cause the problem as when I rewrite the line as: ',' => 250, I no longer have any issues. I have created a patch at the following URL: http://molior.mcs.suffolk.edu/patches/File_PDF-comma.patch.bz2 Expected result: ---------------- Correct generation of a PDF file. Actual result: -------------- Notice: Undefined index: , in /usr/lib/php/File/PDF.php on line 1127

Comments

 [2006-12-11 07:36 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!