PHP 7 HTML2PDF.js Script to Insert Custom TTF Fonts to PDF Document in Browser Using HTML5 & Javascript
<span class="hljs-variable">$html2pdf</span>->setDefaultFont(<span class="hljs-string">"the_name_you_called_your_font"</span>);
<span class="hljs-variable">$html2pdf</span>->AddFont(<span class="hljs-string">'opensans'</span>, <span class="hljs-string">'normal'</span>, <span class="hljs-string">'opensans.php'</span>);
<span class="hljs-variable">$html2pdf</span>->setDefaultFont(<span class="hljs-string">'opensans'</span>);
<span class="hljs-keyword">default</span>: opensans
bold: opensansb
italic: opensansi
bold italic: opensansbi
<span class="hljs-variable">$html2pdf</span>->AddFont(<span class="hljs-string">'opensans'</span>, <span class="hljs-string">'normal'</span>, <span class="hljs-string">'opensans.php'</span>);
<span class="hljs-variable">$html2pdf</span>->setDefaultFont(<span class="hljs-string">'opensans'</span>);
<span class="hljs-keyword">default</span>: opensans
bold: opensansb
italic: opensansi
bold italic: opensansbi
Table of Contents