• Resolved richsan

    (@richsan)


    I have tried to follow the instructions on using Japanese fonts but have had no success. Any guidance would be much appreciated.

    The font fact code I have embedded in the CSS file is:

    @font-face {
        font-family: 'simsun';
        font-style: normal;
        font-weight: normal;
        src: local('simsun'), local('simsun'), url(<?php echo $this->get_template_path(); ?>/fonts/simsun.ttf) format('truetype');
    }

    The font family in the CSS file is defined as:

    font-family: 'simsun';

    The folder structure where I have these files is:
    /wp-content/themes/generatepress/woocommerce/pdf/JWholesale

    This must be correct as the custom template does show in my settings and has been selected.

    But all of the characters continue to show as boxes.

    Any assistance would be much appreciated.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter richsan

    (@richsan)

    Oops, I see that I had not used a ttf file. I have used the same syntax with a ttf file and I now have most of the text showing in Japanese. But there are still a few square boxes don’t display (such as the headers in the table).

    I have marked them up on an image.

    Thread Starter richsan

    (@richsan)

    Image attached.

    • This reply was modified 1 year ago by richsan.
    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @richsan,

    I wonder if those characters are available in the custom font you are trying to use. If so, please note that you have to set the CSS rules for all of these font styles/weights:

    • Font style: normal, Font weight: normal
    • Font style: normal, Font weight: bold
    • Font style: italic, Font weight: normal
    • Font style: italic, Font weight: bold

    See: Using custom fonts

    As a side note, I would like to mention that for our paying customers (with a valid license for Professional?or?Premium Templates) we offer a language pack free of charge, that is plug-and-play, no coding required, to support Chinese, Japanese and Korean characters. So, if you have a valid license, please write us at [email protected], and will send you the language pack extension immediately!

    Thread Starter richsan

    (@richsan)

    Thanks so much for that. Not familiar with font use, so it’s a bit trying at times:-) Once I added the other font weights and styles in it worked fine. Thanks for pointing that out.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for confirming that adding the other weights fixed the issue ??

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

    Thread Starter richsan

    (@richsan)

    Sorry to bother you, need some quick help with this again. My theme update overwrote the custom template files. I had them backed up so was able to restore them, but the fonts are no longer working. I think it’s because the font css definitions have been deleted, but I can’t for the life of me remember where I am supposed to put the custom font face and font family definitions you talk about on your custom font page.

    Thanks.

    Thread Starter richsan

    (@richsan)

    Never mind. It seems I had reinstalled an incremental backup that was missing the css file. Once I found that and put it back in place everything started working fine again. Cheers.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I’m sorry to hear that, @richsan ??

    I guess you created the custom PDF template within the parent theme, instead of a child theme, right? If so, please create a child theme first to avoid losing your customization again.

    Then, please check that you have defined all the combinations of font styles and weights, that I explained above.

    Please check the documentation about this topic, so you can check the example code there: Using custom fonts

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Displaying Japanese in PDF’ is closed to new replies.