tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.18k stars 1.51k forks source link

Umlauts problem / How to find out correct number of the encoding table? #565

Open 1bit opened 1 year ago

1bit commented 1 year ago

If adding new TTF-Fonts without setting $enc to 96 or 32, the font has umlaut Problems:

Problem occurs when adding the font like this: TCPDF_FONTS::addTTFfont('Taxon-Regular.ttf', 'TrueType');

No Umlaut Problems when adding the font with Parameter 96 or 32: TCPDF_FONTS::addTTFfont('Taxon-Regular.ttf', 'TrueType', 96); or TCPDF_FONTS::addTTFfont('Taxon-Regular.ttf', 'TrueType', 32);

The class description says: "Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats.", see https://tcpdf.org/docs/srcdoc/TCPDF/classes-TCPDF-FONTS/#method_addTTFfont

How can I find out the correct number of the encoding table? I can't find any information about this, but its relevant, otherwise the font is displayed wrongly in the pdf.

Thank you for any more information about this.

Nebucadnezar commented 1 year ago

I can confirm this behavior.

I had a problem with the German umlaut Ä becoming a ~ in the PDF. If I set the encoding to 96 it works.

All other German umlauts like Ö Ü ä ö ü also work with auto encoding.

TCPDF version 6.6.2 and PHP 7.4.32