pluginsGLPI / barcode

GNU Affero General Public License v3.0
36 stars 34 forks source link

Incorrect display of Russian characters #70

Open NeonTheOneGit opened 4 years ago

NeonTheOneGit commented 4 years ago

When generating the QR-code, if the element name contains Russian characters, when opening the pdf file, question marks are displayed instead of Russian characters. In the QR-code itself, the text is recognized correctly, incorrect only in the QR-code signature. image

dosgamer commented 4 years ago

You need to select a font with unicode support for this in the file /inc/barcode.class.php replace the line: $pdf->selectFont(Plugin::getPhpDir('barcode')."/lib/ezpdf/fonts/Helvetica.afm"); per lines: $pdf->isUnicode = true; $pdf->selectFont('FreeSerif'); for ttf fonts, you also need the bcmath php library in ubuntu, you can install the package: apt-get install php-bcmath

NeonTheOneGit commented 4 years ago

Thanks, it helped. Should we wait for this in the main version, or will it be necessary to fix it during the update?