• Resolved alexdex

    (@alexdex)


    Hi, i am using Thai language and the invoice is generated with ? instead the Thai letter
    I have installed in the server MBString extension and i enable the Asian Font in the plugin setting but when the invoice is generated is all wrong.
    I am using a google font

    Please help me

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter alexdex

    (@alexdex)

    Somebody can help me?

    Thread Starter alexdex

    (@alexdex)

    I follow a previous support task.

    I add in function.php

    add_filter( ‘wpo_wcpdf_mpdf_options’, function( $options ){
    // get defaults
    $defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
    $fontDir = $defaultConfig[‘fontDir’];
    $defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
    $fontData = $defaultFontConfig[‘fontdata’];

    // setup custom font dir & font data
    $customFontDir = WPO_WCPDF()->settings->get_template_path() . ‘/fonts’;
    $customFontData = [
    ‘Kanit’ => [
    ‘R’ => ‘Kanit.ttf’, // use ‘B’,’I’,’BI’ keys for Bold, Italic & Bold Italic respectively
    ‘useOTL’ => 0xFF,
    ],
    ];

    // merge in options
    $options[‘fontDir’] = array_merge( $fontDir, [ $customFontDir ] );
    $options[‘fontdata’] = $fontData + $customFontData;

    return $options;
    } );

    I am using a custom template and the font is declared on the css. I do not understand why its not working, i have ? instead of the THAI letters. I need help

    Thread Starter alexdex

    (@alexdex)

    Somebody can answer me?

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! The filter you are using here is for the mpdf extension, but if you are already using the mpdf extension, then a custom font should not be required for showing Thai characters. Are you sure you are using the mpdf extension and not the default/built-in engine (dompdf)?

    if you are not using mpdf, you can just follow the instructions from the documentation: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-custom-fonts/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Invoice error caracter Asian Font’ is closed to new replies.