title: TCPDF ERROR: Could not include font definition file: 'stalemate'
body: <p>I have html that uses some script fonts that need to be converted to pdf. I have everything working on this, except when I try and include the script fonts in the pdf it gives the the following error:</p>
  
  <pre><code>TCPDF ERROR: Could not include font definition file: 'stalemate'
  </code></pre>
  
  <p>The original font is from the Google Fonts library. Per instructions I have found, I renamed the font so that it was all lowercase, then made the matrix files using the ttf2ufm utility. I then took these files and used the makefont.php utility to make the needed files for the font to be included in the TCPDF font folder (stalemate.z, stalemate.ctg.z and stalemate.php). I have also tried putting them in a specific folder and pointing the call to that as well.</p>
  
  <p>Seems like I have all the right files in all the right places and still get the above error. If I take out the style for that font on the html, the document PDFs just fine.</p>
  
  <p>I have made a smaller test page at <a href="http://mattodesigns.com/pdfconverter.php" rel="nofollow">http://mattodesigns.com/pdfconverter.php</a>, which take the html from <a href="http://mattodesigns.com/sample.html" rel="nofollow">http://mattodesigns.com/sample.html</a> and converts it to a pdf. The following is the php code:</p>
  
  <pre><code>&lt;?php
  require_once 'html2pdf_v4.03/html2pdf.class.php';
  
  $url = 'http://mattodesigns.com/sample.html';
  $source = file_get_contents($url);
  $html   = str_replace(array("\r", "\n", "\t"), '', $source);
  $orientation    = 'P';
  $format     = 'A4';
  $margins = array(0,0,0,0);
  
  $html2pdf = new HTML2PDF($orientation, $format, 'en', true, 'UTF-8', $margins);
  $html2pdf-&gt;addFont('stalemate', '', 'stalemate.php');
  $html2pdf-&gt;WriteHTML($html);
  $html2pdf-&gt;Output('first_PDF_file.pdf');
  
  ?&gt;
  </code></pre>
  
  <p>The HTML code that it pulls is:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
      @font-face {font-family: "stalemate"; font-weight: 400; src: url(/fonts/stalemate.otf) format("opentype");}
  &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;h1&gt;Make Sure this is working&lt;/h1&gt;
  &lt;p style="font-family: 'stalemate', cursive ;"&gt;This is your first PDF File&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any ideas on this would be great.</p>