Skip to content

Instantly share code, notes, and snippets.

Last active Oct 13, 2017
What would you like to do?
Sensei Certificates: Use custom font in certificate PDFs
* 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;
Copy link

parhaam commented Jul 9, 2017

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.

Copy link

beags121 commented Oct 12, 2017

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