By default, Membership Pro uses TCPDF to generate PDF invoices and membership cards. The Membership Pro - MPDF plugin provides an alternative with better CSS support and documentation. Follow these steps to use it.
The MPDF library only supports certain fonts. If you want to use custom TTF fonts :
<?php
/**
* @package Joomla
* @subpackage Membership Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 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>
table.invoice-container
{
font-family: "Times New Roman";
}
</style>