Answers.Body: <p>Fonts for TCPDF are generated, and are located in civicrm/vendor/tecnickcom/tcpdf/fonts/ in a format like this: </p>
  
  <pre><code>-rw-r--r-- 1 www-data www-data 1,9K Aug  9 14:44 robotoi.ctg.z
  -rw-r--r-- 1 www-data www-data 8,6K Aug  9 14:44 robotoi.php
  -rw-r--r-- 1 www-data www-data  78K Aug  9 14:44 robotoi.z
  </code></pre>
  
  <p>To generate the fonts, a static method from the library addTTFfont is called, and saved to the previously mentioned folder.</p>
  
  <pre><code>$roboto_italic             = TCPDF_FONTS::addTTFfont('/var/www/boell_testing/public/sites/default/files/civicrm/persist/fonts/roboto/roboto/Roboto-Italic.ttf', 'TrueTypeUnicode', '', 32);
  </code></pre>
  
  <p>After this call, the fonts should be available. The civicrm has to be told that there are additional fonts, which is done via a global settings array: </p>
  
  <pre><code>global $civicrm_setting;
  $civicrm_setting['CiviCRM Preferences']['additional_fonts'][$roboto_italic] = "Roboto Italique";
  </code></pre>
  
  <p>In civicrm/CRM/Utils/PDF/Label.php --> public function getFontNames() the fonts are added to the menu and are available in the drop down menus for, in this case name Badges. But every other PDF generator using TCPDF should have the fonts as well.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-23T11:39:37.797Z
Answers.Text: Depending on your setup, this can cause problems in different stages of bootstrapping CiviCRM, since for example for tests or API Commands TCPDF wont be loaded, thus it fails. I would suggest to generate the fonts like this post, and then statically add them afterwards 
  ```$civicrm_setting['CiviCRM Preferences']['additional_fonts']['robotoi'] = "Roboto Italique";
  ```
Answers.UserDisplayName: Phil_B
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-10T08:01:09.210Z
Answers.LastActivityDate: 2018-08-10T08:01:09.210Z
Answers.UserDisplayName: Phil_B
Body: <p>How do I add additional Fonts to CiviCRM, especially where wkhtmltopdf and dompdf aren't used?</p>
  
  <p>This is the case when name Badges for an event are printed, and the font isn't capable of of special chars in names.</p>
  
  <p>There is some information already here - but I had to puzzle and try and error a lot, so I decided to write question and answer a bit more conclusively here.</p>
  
Tags: <pdf>
Title: Additional Fonts for TCPDF
ThreadText: # Additional Fonts for TCPDF
  
  (Asked by: username_0 on 2018-08-10)
  
  How do I add additional Fonts to CiviCRM, especially where wkhtmltopdf and dompdf aren't used?
  
  This is the case when name Badges for an event are printed, and the font isn't capable of of special chars in names.
  
  There is some information already here - but I had to puzzle and try and error a lot, so I decided to write question and answer a bit more conclusively here.
  
  **Tags:** pdf
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-08-10. Score: 3 | Accepted answer
  
  Fonts for TCPDF are generated, and are located in civicrm/vendor/tecnickcom/tcpdf/fonts/ in a format like this:
  
  ```
  -rw-r--r-- 1 www-data www-data 1,9K Aug  9 14:44 robotoi.ctg.z
  -rw-r--r-- 1 www-data www-data 8,6K Aug  9 14:44 robotoi.php
  -rw-r--r-- 1 www-data www-data  78K Aug  9 14:44 robotoi.z
  
  ```
  
  To generate the fonts, a static method from the library addTTFfont is called, and saved to the previously mentioned folder.
  
  ```
  $roboto_italic             = TCPDF_FONTS::addTTFfont('/var/www/boell_testing/public/sites/default/files/civicrm/persist/fonts/roboto/roboto/Roboto-Italic.ttf', 'TrueTypeUnicode', '', 32);
  
  ```
  
  After this call, the fonts should be available. The civicrm has to be told that there are additional fonts, which is done via a global settings array:
  
  ```
  global $civicrm_setting;
  $civicrm_setting['CiviCRM Preferences']['additional_fonts'][$roboto_italic] = "Roboto Italique";
  
  ```
  
  In civicrm/CRM/Utils/PDF/Label.php --> public function getFontNames() the fonts are added to the menu and are available in the drop down menus for, in this case name Badges. But every other PDF generator using TCPDF should have the fonts as well.
  
  > **Comments:**
  > **username_0**: Depending on your setup, this can cause problems in different stages of bootstrapping CiviCRM, since for example for tests or API Commands TCPDF wont be loaded, thus it fails. I would suggest to generate the fonts like this post, and then statically add them afterwards  ```$civicrm_setting['CiviCRM Preferences']['additional_fonts']['robotoi'] = "Roboto Italique"; ```  
  
  ---
  
  