CSS font-family name
Every font family has a name which is defined in the font file. This is the name by which your computer OS registers and recognises the font family.
This is also the name used in CSS e.g.
mPDF font-family name
This is the name used by mPDF internally to process fonts. This could be anything you like, but by default mPDF will convert CSS font-family names by removing any spaces and changing to lowercase. Reading the CSS name above, mPDF will look for a "mPDF font-family name" of 'trebuchetms'. This means that this will also work:
Next it will look for a translation in `$this->fonttrans` in the config_fonts.php file. Imagine that we also wished to recognise 'Trebuchet', we would add: mPDF font-family names should therefore always be lower-case and contain no spaces. When mPDF needs to refer to a specific variant (bold, italic etc.) it will use the mPDF font-family name (lowercase) followed by 'B', 'I', or 'BI' (uppercase). The regular/normal Trebuchet MS will be 'trebuchetms', and the bold variant will be referred to as 'trebuchetmsB'. These mPDF font names are used in other places:
- all the other configurable variables in the config_fonts.php use the mPDF font-family name
- use the mPDF font name in the config_cp.php file to make it selectively available in certain languages.
- if used in the PHP script e.g. $mpdf = new mPDF('','','','trebuchetms');