0

I'm involved in a pretty big and complex svn project in Netbeans. I'm not really experienced in PHP, more like basic knowledge level. I'm stuck with the rendering of the PDF report file for a customer who uses Bulgarian language (Cyrillic win1251 or koi8-r).

The PDF creation class I used is R&OS PDF class (Cpdf.php & Cezpdf.php, Cezpdf extends Cpdf), recently updated it to 0.11.6, which supports UTF-8.

According to the manual of the class, I have to use ttf2ufm (installed it from repository) to encode fonts, or something.

The font I want to use is Helvetica or Times Roman, nothing complex. It is already included in the fonts folder of the class.

If someone can explain this to me, in detail it would save me a lot of time, and we all know time is always short :)

dda
  • 6,030
  • 2
  • 25
  • 34

1 Answers1

0

Helvetica and Times Roman are core fonts. These fonts do not support unicode I guess.

To use unicode characters you need to download unicode fonts. Such as Arial Unicode from MS (purchase) or FreeSerif as an Opensource alternative

Simply download the font, run "ttf2ufm -a FreeSerif.ttf" (-a stands for a glyphs) and use:

$pdf->selectFont('fonts/FreeSerif')

There is also one example available here:

http://pdf-php.sourceforge.net/pdf-php-code/examples/unicode.php

http://pdf-php.sourceforge.net/pdf-php-code/examples/unicode.phps for the source

Ole K
  • 754
  • 1
  • 9
  • 32