On Jul 29, 2008, at 8:53 AM, Mark Steudel wrote:
I’m playing around with the PDF classes, and am trying to utilize
some non-standard fonts. In the documentation it says that it can
use TTF and OTF fonts. So I tried copying one of my windows fonts
that was an OTF over to try out. I ended up getting the following
error:
Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message
'Cannot determine font type: MyriadPro-Bold.otf' in C:\wamp\www
\domain.com\Zend\library\Zend\Pdf\Font.php:714 Stack trace: #0 C:
\wamp\www\domain.com\domain.com\pdf\index.php(12):
Zend_Pdf_Font::fontWithPath('MyriadPro-Bold....') #1 {main} thrown
in C:\wamp\www\studiob-gso.com\Zend\library\Zend\Pdf\Font.php on
line 714
Obviously it didn’t like my font. Is there a way to know before hand
whether or not a font I have will work or not?
Zend_Pdf should work with any TrueType font or OpenType font if it
contains TrueType outlines. If the OpenType font contains Type1
outlines, it won't work yet.
Run the following code and let me know what, if any, exception is
thrown:
require_once 'Zend/Pdf/Font.php';
$dataSource = new Zend_Pdf_FileParserDataSource_File($pathToFontFile);
$fontParser = new
Zend_Pdf_FileParser_Font_OpenType_TrueType($dataSource);
$font = new
Zend_Pdf_Resource_Font_Simple_Parsed_TrueType($fontParser, 0);
--
Willie Alberty
Spenlen Media
[EMAIL PROTECTED]
http://spenlen.com/