title: How to embed fonts into a PDF with TCPDF?
body: <p>I have tried to use TCPDF whose code is given below:</p>
  
  <pre><code>require_once($_SERVER['DOCUMENT_ROOT'].'/tcpdf/tcpdf.php'); 
  $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  $pdf-&gt;SetCreator(PDF_CREATOR);
  $pdf-&gt;SetAuthor('Nicola Asuni');
  $pdf-&gt;SetTitle('TCPDF Example 061');
  $pdf-&gt;SetSubject('TCPDF Tutorial');
  $pdf-&gt;SetKeywords('TCPDF, PDF, example, test, guide');
  $pdf-&gt;setPrintHeader(false);
  $pdf-&gt;setPrintFooter(false);
  $pdf-&gt;SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
  $pdf-&gt;SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
  $pdf-&gt;SetHeaderMargin(PDF_MARGIN_HEADER);
  $pdf-&gt;SetFooterMargin(PDF_MARGIN_FOOTER);
  $pdf-&gt;SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
  if (@file_exists($_SERVER['DOCUMENT_ROOT'].'/tcpdf/config/lang/eng.php')) {
      require_once($_SERVER['DOCUMENT_ROOT'].'/tcpdf/config/lang/eng.php');
      $pdf-&gt;setLanguageArray($l);
  }
  $pdf-&gt;SetFont('helvetica', '', 10); 
  $html ="";
  $pdf-&gt;AddPage();
  $html .='&lt;style&gt;'. file_get_contents('http://localhost/Projects/PDF/css/style_4.css').'&lt;/style&gt;';
  $html .= file_get_contents("http://localhost/Projects/PDF/mycon.php"); 
  $pdf-&gt;writeHTML($html, true, false, true, false, '');
  $pdf-&gt;lastPage();
  $pdf-&gt;Output('example_061.pdf', 'I');
  </code></pre>
  
  <p>The above code generates a PDF successfully but is not taking my CSS and fonts that I have defined into "style_4.css" and included externally. </p>
  
  <p>I have also tried to include CSS on the page itself "mycon.php" but its not taking from there as well. What am I doing wrong?</p>
  
  <p><strong>Note:</strong> I have different fonts which will be dynamically attached with layout based on certain conditions.</p>