• Resolved jlev00

    (@jlev00)


    Hi – has something changed recently which would prevent our Japanese fonts from rendering?

    We have custom templates which load fonts based on the documentation here: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-custom-fonts/

    Specifically, in our styles.css we have the following code:

    @font-face {
    font-family: 'NotoSansJP';
    font-style: normal;
    font-weight: normal;
    src: local('NotoSansJP'), local('NotoSansJP'), url(get_template_path(); ?>/fonts/NotoSansJP-Regular.ttf') format('truetype');
    }

    @font-face {
    font-family: 'NotoSansJP';
    font-style: normal;
    font-weight: bold;
    src: local('NotoSansJP'), local('NotoSansJP'), url(get_template_path(); ?>/fonts/NotoSansJP-Bold.ttf') format('truetype');
    }

    and

    font-family: 'NotoSansJP';

    Has something changed recently? Do I need to make a change to the above code?

    Any assistance would be greatly appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Mohamad

    (@mohamadntr)

    Hi @jlev00,

    We didn’t recently change anything that could affect that.

    Could you tell me what the current font of your invoices is?

    You can add &output=html at the end of an invoice link to see the HTML version of it, and check the font.

    Additionally, could you please verify that the correct template has been selected?

    Thread Starter jlev00

    (@jlev00)

    Hi Mohamed – thanks for your response.

    The Japanese characters render correctly in the HTML version.

    When I inspect any element they are correctly prioritising font-family: 'NotoSansJP';

    This issue is happening on two websites. The both share similar hosting/stack, and use the same template, so I am looking at these also.

    Plugin Contributor Mohamad

    (@mohamadntr)

    Could you try setting a different font to see if the issue is resolved?

    Thread Starter jlev00

    (@jlev00)

    It looks like replacing

    src: local('NotoSansJP'), local('NotoSansJP'), url(get_template_path(); ?>/fonts/NotoSansJP-Regular.ttf') format('truetype');

    with

    src: local('NotoSansJP'), local('NotoSansJP'), url('https://website.com/wp-content/themes/childtheme/woocommerce/pdf/templatename/fonts/NotoSansJP-Regular.ttf') format('truetype');

    has worked. Weird.

    • This reply was modified 10 months ago by jlev00.
    Plugin Contributor Mohamad

    (@mohamadntr)

    @jlev00 Glad to hear it is resolved.

    The issue was probably because of not using <?php echo before get_template_path().

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Japanese Font No Longer Rendering’ is closed to new replies.