title: TCPDF - how to add a font to pdf
body: <p>While using TCPDF to generate pdf files I am trying to embed fonts to my pdf file. I have read about it in manuals and i've been googling for it for a few hours.</p>
  
  <p>I used that method:</p>
  
  <pre><code>$fontname = $pdf-&gt;addTTFfont('/fonts/aller.ttf', '', '', 32);
  </code></pre>
  
  <p>After that I have 3 files in my tcpdf fonts directory: aller.php, aller.z and aller.ctg.z
  I set font like this:</p>
  
  <pre><code>$pdf-&gt;SetFont('aller', '', 20, '', true)
  </code></pre>
  
  <p>Unfortunatelly I get dots in my pdf file and error message saying "Cannot extract the embedded font 'AAAAAD+Aller,Bold'. Some characters may not display or print correctly."</p>
  
  <p>I am using windows so i cant use ttf2atm.exe and call php -q makefont.php as suggested in some tutorials.</p>
  
  <p>I found here in SO a question <a href="https://stackoverflow.com/questions/8861260/specific-fonts-in-tcpdf-pdf">link</a> but there was no solution. </p>
  
  <p>Does anybody know how to add totally new font to tcpdf pdf file? I want to add Aller font (you can download it from <a href="http://pl.fonts2u.com/aller.czcionka?ptext=Konkurencje:&amp;size=&amp;submit=Wy%C5%9Blij" rel="nofollow noreferrer">here</a> - just klik on 'pobieraj' link.</p>
  
  <p>Help would be appreciated.</p>
  
  <p>Kalreg.</p>
  
  <p><strong>Problem has been solved - unfortunatelly the font i was trying to embed was corrupted - any other works fine with $pdf->addTTFfont() method.</strong></p>