ZF-3649: Special characters

Issue Type: Bug Created: 2008-07-15T09:22:07.000+0000 Last Updated: 2008-07-15T10:44:10.000+0000 Status: Resolved Fix version(s): Reporter: Martynas (martis) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Pdf

Related issues: - ZF-3650



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.


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).

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.