title: How do you add custom fonts in TCPDF?
body: <p>I would like to add a custom font to a pdf I'm generating using TCPDF.  I might be missing something but <a href="http://www.tcpdf.org/fonts.php" rel="noreferrer">the docs</a> seem to be out dated.  They are referencing the <code>addTTFfont()</code> function but I think it's been deprecated and no longer exists in the latest version of TCPDF.</p>
  
  <p>I read that I need to convert the ttf file and put it in the fonts folder so I ran:</p>
  
  <pre><code>php/tcpdf/tools/tcpdf_addfont.php -i php/font/rumpelstiltskin-webfont.ttf
  </code></pre>
  
  <p>and it generated these files which are now in the fonts folder:</p>
  
  <pre><code>rumpelstiltskinwebfont.ctg.z
  rumpelstiltskinwebfont.z
  rumpelstiltskinwebfont.php
  </code></pre>
  
  <p>Then I tried to add the font:</p>
  
  <pre><code>$pdf-&gt;addFont('rumpelstiltskin');
  $pdf-&gt;SetFont('rumpelstiltskin', '', 14, '', false);
  </code></pre>
  
  <p>but I'm getting an error:</p>
  
  <pre><code>TCPDF ERROR: Could not include font definition file: rumpelstiltskin
  </code></pre>