mPDF Manual – mPDF Variables

falseBoldWeight

(mPDF ≥ 4.2)

falseBoldWeight – Specify weight used for bold text when using an artificial (outline) bold

Description

void falseBoldWeight

Specify weight used for bold text when using an artificial (outline) bold. If bold text is set by <b> and the current font does not have a font file for the bold variant, an artificial bold is created by stroking the outline of the characters. This variable sets the width of the line and thus the “weight” of the bold text. Values between 0 and 10 are recommended.

Values

$falseBoldWeight

Values

  • INTEGER : set weight of bold text

Default: 5

Changelog

Version Description
4.2 Variable was added.

Examples

<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();

$mpdf->falseBoldWeight = 8;

$mpdf->WriteHTML('<p style="font-family: mysimplefont"><b>Hello World</b><p>');
$mpdf->Output();

Fork me on GitHub