2

I'm trying to implement @Phil_B's instructions here on how to add a custom font to CiviCRM that can be used in thank you letter PDFs, but honestly I don't think I'm doing it right.

I added a file named gotham.php to civicrm/vendor/tecnickcom/tcpdf/fonts/.

gotham.php:

$gotham_font = TCPDF_FONTS::addTTFfont('/home/freed/www/www/wp-content/uploads/2024/05/GothamMedium.ttf', 'TrueTypeUnicode', '', 32);
global $civicrm_setting;
$civicrm_setting['CiviCRM Preferences']['additional_fonts'][$gotham] = "Gotham";

I'm not seeing a font option in the CKEditor and when I put <p font="Gotham">abc</p> in the source, that doesn't work either.

What am I missing?

Thanks!

2 Answers 2

3

Thankyou letters don't use tcpdf, they use dompdf or wkhtmltopdf, or as of recently, weasyprint, depending on the choice on the admin - system settings - misc page.

See also https://docs.civicrm.org/installation/en/latest/general/unicode_pdf. The same technique for dejavu font would work for some other font.

1
  • Thank you, @Demerit! This worked perfectly. Commented May 17 at 15:34
2

You could also consider using the CiviOffice Extension. It would give you the opportunity to use custom fonts either by embedding them in docx documents or by stroing them on the server as described here.

However, while CiviOffice can generate thank you letters etc. it does not use the core feature for it so make sure that it covers your requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.