Answers.Body: <p>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 <a href="https://docs.civicrm.org/civioffice/en/latest/usage/custom-fonts/" rel="nofollow noreferrer">here</a>.</p>
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-17T06:54:43.603Z
Answers.LastActivityDate: 2024-05-17T06:54:43.603Z
Answers.UserDisplayName: Fabian
Answers.Body: <p>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.</p>
  <p>See also <a href="https://docs.civicrm.org/installation/en/latest/general/unicode_pdf" rel="nofollow noreferrer">https://docs.civicrm.org/installation/en/latest/general/unicode_pdf</a>. The same technique for dejavu font would work for some other font.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-17T15:34:09.050Z
Answers.Text: Thank you, @Demerit! This worked perfectly.
Answers.UserDisplayName: Carl Sigmond
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-17T02:11:14.750Z
Answers.LastActivityDate: 2024-05-17T02:11:14.750Z
Answers.UserDisplayName: Demerit
Body: <p>I'm trying to implement @Phil_B's instructions <a href="https://civicrm.stackexchange.com/questions/26083/additional-fonts-for-tcpdf">here</a> 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.</p>
  <p>I added a file named <code>gotham.php</code> to <code>civicrm/vendor/tecnickcom/tcpdf/fonts/</code>.</p>
  <p><code>gotham.php</code>:</p>
  <pre><code>$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] = &quot;Gotham&quot;;
  </code></pre>
  <p>I'm not seeing a font option in the CKEditor and when I put <code>&lt;p font=&quot;Gotham&quot;&gt;abc&lt;/p&gt;</code> in the source, that doesn't work either.</p>
  <p>What am I missing?</p>
  <p>Thanks!</p>
  
Tags: <pdf>
Title: Using a custom font in thank you letter PDFs
ThreadText: # Using a custom font in thank you letter PDFs
  
  (Asked by: username_0 on 2024-05-16)
  
  I'm trying to implement @Phil\_B's instructions [here](https://civicrm.stackexchange.com/questions/26083/additional-fonts-for-tcpdf) 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!
  
  **Tags:** pdf
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2024-05-17. Score: 3 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: Thank you, @username_2! This worked perfectly.  
  
  ---
  
  ### Answer by username_1 on 2024-05-17. Score: 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](https://docs.civicrm.org/civioffice/en/latest/usage/custom-fonts/).
  
  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.
  
  
  ---
  
  