[fpc-pascal] fpPDF and support of Latin2 charset

Michael Van Canneyt michael at freepascal.org
Tue Mar 19 09:50:59 CET 2019



On Tue, 19 Mar 2019, LacaK wrote:

> Hi,
>
> I am trying work with fpPDF. I can create PDF document, but character out of 
> ASCII range are displayed wrong (in PDF file they are stored as UTF8).
> Probably it is because I use standard Courier font, which is expecting only 
> "Latin characters" ? I use:
>
> FontIndex := PDF.AddFont('Courier'); // --> test1.pdf
>
> When I want to use TTF font:
>
> FontIndex := PDF.AddFont('cour.ttf','CourierNew');  // --> test2.pdf
> (nothing else this line has changed)
>
> I get strange PDF file (I can open it but content is wrong)
>
> What I am doing wrong? Is there way how to get correct PDF with characters 
> from Latin2 code page?

Not to my knowledge. 
You must use unicode for characters outside the ASCII range.

> Is there way how to get correct PDF file WITHOUT embedding full Courier font?

You can embed only the needed characters for every font ?

Michael.


More information about the fpc-pascal mailing list