Cyrillic issue

Re: Cyrillic issue

by Jean-Michel Védrine -
Number of replies: 0

Hello Uugankhuu,

To change the font, just edit the mod/certificate/type/mytype/certificate.php file (replace mytype with the certificate type you are using) with an editor (be sure to choose an editor that let you save the file as UTF-8 encoded so if you are on Windows don't use wordpad or notepad, I use notepad++)

Find the line that print the text where you need foreign characters, it will look something like

certificate_print_text($pdf, $x, $y + 36, 'C', 'Helvetica', '', 30, fullname($USER));

just replace 'Helvetica' with 'freesans', without changing anything else, save the file and you are done.

If the line you are interested in has no font like:

certificate_print_text($pdf, $custx, $custy, 'L', null, null, null, $certificate->customtext);

just add one

certificate_print_text($pdf, $custx, $custy, 'L', 'freesans', null, null, $certificate->customtext);

It will not break your Moodle, the worst which can happen is that no certificate get printed, so be sure to keep a copy of the original file before editing it just in case smile