ZF-3649: Special characters
Description
Try tu creat PDF document with special characters like 'ąčęėįšųūž' then i creat PDF document i see only 'šž' in document. All this ąčęėįšųūž characters is used in Lithuanian language.
Here is code example:
$message = 'ąčęėįšųūž'; $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 20); $page->drawText($message, 100, 510, 'UTF-8');
In created documen i see only - 'šž'
So i try include font. Code example:
$message = 'ąčęėįšųūž'; $include_font = Zend_Pdf_Font::fontWithPath('times.ttf'); $page->setFont($include_font, 20); $page->drawText($message, 100, 510, 'UTF-8');
Now in created PDF document i see all his characters which and try - 'ąčęėįšųūž'. Result is good.
So problem is with Zend_Pdf_Font::FONT_HELVETICA. Also try all standard 14 PDF fonts, but rezult is same.
Comments
Posted by Alexander Veremyev (alexander) on 2008-07-15T10:44:10.000+0000
That's correct behavior.
Standard PDF fonts support only Latin1 character set (actually some superset of Latin1 CS), even input string fro text drawing is represented in 'UTF-8' or any other encoding. Appropriate TTF fonts should be used for other character sets.
I've just registered it as a Documentation improvment issue (ZF-3650).