(mPDF ≥ 5.0)
If a font or default font is declared in mPDF (including the default stylesheet, and any CSS stylesheets etc.) the fontthat is actually set is determined by:
If called in HTML/CSS the font-family name is converted to an mPDF font-family name (seeFont names in 5.x) e.g.
...FIXMEThe font requested (including style) is checked to see if it is available to mPDF: set by the array$available_unifonts:
trebuchetms['B']trebuchetms['R']sans_fonts, serif_fonts, andmono_fonts defined inmpdf_config.php , in this case looking for ‘trebuchetms’. If found, substitutes afont of similar type (sans-serif, serif, or mono) - the first font in thesans_fonts, serif_fonts, ormono_fontsarrays is used.$available_unifonts* is selected* The array $available_unifonts is initially derived from$this->fontdata in theconfig_fonts.phpfile. (trebuchetms['B'] will be converted to ‘trebuchetmsB' The array can be altered when certain languages are defined e.g.when using lang markup in the HTML code:
If ‘ar’ (arabic) is set as the language, the default settings inconfig_cp.php define arestricted set of fonts which can be selected. In the example case, mPDF will look fortrebuchetmsB and if notavailable,trebuchetms
If core fonts only are specified by using$mpdf = new \Mpdf\Mpdf('c'), then all font requests will be substituted byArial/Helvetica, Times or Courier i.e. the core PDF fonts. mPDF determines whether the requested font is a sans-serif,serif or monospace font (as above), and substitutes accordingly.
If some circumstances, individual characters are replaced by glyphs from another font - seecharacter (font) substitution.