html - TCPDF Set Font via CSS font-family -


i'm using latest version of tcpdf, , found cannot set fonts cssfont-family when using writehtml method. only way font set if use setfont, won't work out nicely me document needs have multiple fonts , template created using 1 html view file.

here's template file far:

<style media="all">     html, body, p, h1, h2, h3, td, span {         font-family: 'heavydisplay' !important;         font-size: 10pt;     } </style>  <table cellspacing="0" cellpadding="0" border="0">     <tr>         <td style="font-size:27pt;color:#2998ff">tax receipt</td>         <td rowspan="2">company name</td>     </tr>     <tr>         <td style="font-size:7pt;letter-spacing:.8pt;color:#999">&nbsp;<br>please retain income tax purposes</td>     </tr> </table> 

i can confirm font-size property works.

additionally, have tried inlining font-family property each tag, doesn't make difference.

is bug tcpdf?

please don't use library tcpdf or others using <style> tag or css file

<style media="all">     html, body, p, h1, h2, h3, td, span {         font-family: 'heavydisplay' !important;         font-size: 10pt;     } </style> 

better use style attribute instead <style> tag or css file

<body style="font-family: 'heavydisplay' !important;font-size: 10pt;"></body> 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -