How to add Open Sans font to mpdf document
<p>I'm trying to add <code>Open Sans</code> font to my mpdf document but without success.</p>

<p>This is the code I added to the previous files:</p>

<p>In <code>mpdf/config_fonts.php</code>:</p>

<pre><code>$this-&gt;fontdata = array(
...
    "opensans" =&gt; array( 
        'R'  =&gt; "OpenSans-Regular.ttf",
        'B'  =&gt; "OpenSans-Semibold.ttf",
        'I'  =&gt; "OpenSans-LightItalic.ttf",
        'BI' =&gt; "OpenSans-Semibolditalic.ttf"
    ),
...
);
</code></pre>

<p>In the php output file I added this:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;style&gt;
    body {
        font-family: 'Open Sans';
        font-size: 10pt;
    }
</code></pre>

<p>I also already tried to write <code>font-family: opensans, sans-serif;</code></p>

<p>I uploaded the files into the folder: <code>root/plugins/mpdf/ttfonts/</code></p>

<p>I think I did everything correctly but didn't work, it use the first sans substitutive font.</p>

<p>Extra info:
the mpdf folder is located at his path: <code>root/plugins/</code>
the php file is creating the pdf file is located at this path: <code>root/template/folder/</code>
inside it I declared these:</p>

<pre><code>define('_MPDF_PATH','../../plugins/mpdf/');
include("../../plugins/mpdf/mpdf.php");
</code></pre>

<p>probably there is something wrong with the paths, but I don't find the solution.</p>

<p>In addition I can say that If I load the <code>font-family: opensans, sans-serif;</code>, inside the example <code>examples/example02_CSS_styles.php</code> that it works correctly.</p>

<p>How can I solve?</p>