ZF-5133: Zend_PDF::fontWithPath happens exception on i5/OS

Description

I find Zend_PDF::fontWithPath happens exception on i5/OS if I use TrueType font file that has Japanese in font name property.

I think getFontName() of Zend/Pdf/Resource/Font.php has some problem.

Comments

Probably, I think this issue depends on not supported encoding on iconv.

code sample


$pdf = new Zend_Pdf();
$font = Zend_Pdf_Font::fontWithPath('/usr/local/zftest/ipafont/ipagp.otf');

causes


#0 /usr/local/Zend/ZendFramework/library/Zend/Pdf/Resource/Font/CidFont.php(119): Zend_Pdf_Element_Name->__construct('?I?P?A?P?G?o?t?...')
#1 /usr/local/Zend/ZendFramework/library/Zend/Pdf/Resource/Font/CidFont/TrueType.php(57): Zend_Pdf_Resource_Font_CidFont->__construct(Object(Zend_Pdf_FileParser_Font_OpenType_TrueType), 0)
#2 /usr/local/Zend/ZendFramework/library/Zend/Pdf/Font.php(752): Zend_Pdf_Resource_Font_CidFont_TrueType->__construct(Object(Zend_Pdf_FileParser_Font_OpenType_TrueType), 0)
#3 /usr/local/Zend/ZendFramework/library/Zend/Pdf/Font.php(686): Zend_Pdf_Font::_extractTrueTypeFont(Object(Zend_Pdf_FileParserDataSource_File), 0)
#4 /usr/local/zftest/application/default/controllers/PdfController.php(22): Zend_Pdf_Font::fontWithPath('/usr/local/zfte...')
#5 /usr/local/Zend/ZendFramework/library/Zend/Controller/Action.php(512): PdfController->outputAction()
#6 /usr/local/Zend/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(288): Zend_Controller_Action->dispatch('outputAction')
#7 /usr/local/Zend/ZendFramework/library/Zend/Controller/Front.php(945): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#8 /usr/local/zftest/application/bootstrap.php(19): Zend_Controller_Front->dispatch()
#9 /usr/local/zftest/public/index.php(8): require('/usr/local/zfte...')
#10 {main}

Zip of the OTF file.

The problem may be specific to AIX and i5/OS.

Font name would be converted by mistake if the font name contains multibyte characters. Because you can not use UTF-16BE encoding with the AIX and i5/OS.

I find TCPDF library (from www.tcpdf.org) can work fine with Zend Core for i5/OS 2.0.1 . :-)

So I change the Priority from Major to Trivial.

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.