Enable Japanese font for PDF invoices

If you are a user of our invoicing add-on, and need to insert Japanese characters on the resulting PDF invoices, here is how you can add support for them.

add_filter('cuar/private-content/invoices/pdf/html2pdf-object', 'wpca_tweaks_enable_japanese_pdf_font', 10, 1);

function wpca_tweaks_enable_japanese_pdf_font($html2pdf)
{
    $html2pdf->addFont('cid0jp', '', CUAR_PLUGIN_DIR . '/libs/php/html2pdf/vendor/tecnickcom/tcpdf/fonts/cid0jp.php');
    $html2pdf->setDefaultFont('cid0jp');

    return $html2pdf;
}