MPDF不允许Helvetica Neue字体家族

时间:2018-08-23 13:02:33

标签: mpdf font-family

require_once __DIR__ . '/mpdf/vendor/autoload.php';

$defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
$fontDirs = $defaultConfig['fontDir'];

$defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
$fontData = $defaultFontConfig['fontdata'];

$mpdf = new \Mpdf\Mpdf([
                'fontDir' => array_merge($fontDirs, [
                    __DIR__ . '/fonts/',
                   ]),
                    'fontdata' => $fontData + [
                        'HelveticaNeueR' => [
                            'R' => 'HelveticaNeue.ttf',
                             'I' => 'HelveticaNeue Light.ttf',
                            'useOTL' => 0xFF,
                            'useKashida' => 75                 
                            ]
                        ],
                        //'default_font' => 'HelveticaNeueR'
                    ]); 

0 个答案:

没有答案