Sensei Certificates: Use custom font in certificate PDFs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom fonts MUST be uploaded to the following directory: | |
* /wp-content/plugins/sensei-certificates/lib/tfpdf/font/unifont/ | |
* | |
* All custom fonts MUST be TrueType fonts (.ttf) | |
* | |
* Only one custom font can be used and it will override ALL fonts in ALL templates | |
**/ | |
add_filter( 'sensei_certificates_custom_font', 'certificates_custom_font', 10, 1 ); | |
function certificates_custom_font( $font ) { | |
// Font family and file name MUST be supplied | |
$font = array( | |
'family' => 'FontFamily', | |
'file' => 'font-file.ttf', | |
); | |
// Sepcifying font size is optional - if it is left out the then the sizes specified in the template will be used | |
$font['size'] = 18; | |
return $font; | |
} | |
?> |
Since update to latest Sensei this function causes an error when previewing/accessing the Sensei Certificates from either admin or customer interface. # #
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
Persian letters are written from right to left and joined in the certificate sensie plugin, pdf certificates are written in Persian letters separated from one another and left to right. How to fix this problem.