By default, Events Booking uses TCPDF library to generate PDF (invoices, member cards). While it is good, does not have good support for css and good documentation, so we decided to implement a new plugin called Events Booking - MPDF to address these limitations.
The MPDF library only supports certain fonts. If you want to use custom TTF fonts :
<?php
/**
* @package Joomla
* @subpackage Events Booking
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2010 - 2023 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
// This is a sample config.php file which can be used to load custom font into MPDF, see https://mpdf.github.io/fonts-languages/fonts-in-mpdf-7-x.html for documentation
return [
'fontdata' => [ // lowercase letters only in font key
'frutiger' => [
'R' => 'Frutiger-Normal.ttf',
'I' => 'FrutigerObl-Normal.ttf',
],
],
'default_font' => 'frutiger',
// You can also pass following custom config keys with it values to override default settings if needed
// 'default_font_size' => 10,
// 'margin_left' => 0,
// 'margin_top' => 0,
// 'margin_right' => 0,
// 'margin_bottom' => 0,
// 'margin_footer' => 0,
];
As you can see from the code above, frutiger is font family, Frutiger-Normal.ttf is the font file for Regular style, FrutigerObl-Normal.ttf is the font file for Italic style. See https://mpdf.github.io/fonts-languages/fonts-in-mpdf-7-x.html for more details documentation
<style>
body
{
font-family: "Times New Roman";
}
</style>