Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #592439

    I’ve read the following two posts regarding adding an additional Google font:

    https://kriesi.at/support/topic/adding-google-fonts-plural/

    http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/

    I would like to add the font “Noto Sans CJK JP”

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Noto Sans CJK JP'] = 'Noto Sans CJK JP';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Noto Sans CJK JP'] = 'Noto Sans CJK JP';
    return $fonts;
    }
    

    But it doesn’t seem to be working. The font shows up in the list of selectable fonts, but if I choose the font, it doesn’t seem to be “applying” the font to the actual page.

    It font should look like this:
    https://www.google.com/get/noto/#sans-jpan

    But it currently looks like this (The Japanese text you can see is in a “Text Block” content element. I noticed that the text is currently “h2” heading so I also went to the “Advanced Styling” tab and tried to set the “h2” heading font to “Noto Sans CJK JP” but it still doesn’t seem to be working):
    http://www.jabble.jp/testblog/pricing/

    I appreciate your help!

    Thank you.

    Kelly

    #593135

    Hi Kelly,

    Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Best regards,
    Rikard

    #593607

    Rikard,

    Thank you!

    Kelly

    #594320

    Hi!

    To easily manage google fonts please use one of the available plugins here https://wordpress.org/plugins/search.php?q=google+font

    this one is good too https://wordpress.org/plugins/wp-google-fonts/

    Cheers!
    Vinay Kashyap

    #594735

    Vinay,

    Thank you for your response, but those plugins still don’t seem to have support for “Noto Sans CJK JP”

    They all suggest pretty complicated PHP edits to modify their own plugins.

    Please advise.

    Thank you.

    Kelly

    #594946

    Hey!

    Ohk! The google api won’t allow Nato Sans CJK JP at the moment

    I searched around for a working solution and found a easy one please try this in function.php make sure you are using a child theme so your edits wont be lost when you do a theme update :)

    kriesi.at/documentation/enfold/using-a-child-theme/

    https://wordpress.org/support/topic/possible-to-add-other-fonts?replies=15#post-5013868

    Best regards,
    Vinay Kashyap

    #595514

    Vinay,

    Thank you for your reply.

    I’ve gone ahead and implemented a child theme. That is working okay.

    Regarding the font, I was actually trying the solution posted in the link you mentioned (https://wordpress.org/support/topic/possible-to-add-other-fonts?replies=15#post-5013868), before you suggested it. Unfortunately, I’ve been having problems with that fix and have posted an inquiry with the developer of that plugin. You can see my inquiry here:

    https://wordpress.org/support/topic/advanced-tab-google-fonts-api-key-field-not-visible

    When I was implementing the child theme, another possible solution came to mine. I thought I could actually host the font locally on my server. So I downloaded the “Nato Sans CJK JP” from Google Fonts, uploaded it to my enfold-child theme folder, and added the following code to my child theme’s style.css file:

    @font-face {
    font-family: NotoSansJPReg;
    src: local('NotoSansCJKjp-Regular.otf');
    }

    So my only question is: how can I make the Enfold “General Styling” and “Advanced Styling” tabs’ font option selectors “see” the “NotoSansJPReg” font.

    Thank you for your continued support. Being able to use (better) Japanese fonts is actually critical for my site that is being developed for a Japanese audience.

    Kelly

    #595547

    Hey!

    Child themes are best way to start customizing the theme :)

    Please check this thread https://kriesi.at/support/topic/add-custom-self-hosted-font-to-enfold-fonts-list/

    Here is a more detailed decription of @font face http://justcreative.com/2013/01/22/how-to-use-custom-fonts-with-font-face-on-wordpress/

    If you have the ttf and otf format of the font you can also use this plugin https://wordpress.org/plugins/use-any-font/

    Cheers!
    Vinay Kashyap

    #598321

    Vinay,

    Thank you for your reply.

    To make a long story short, I’m abandoning using Nato Sans CJK JP. It turns out that in order to apply the font to the entirety of my site, I have to make different subsets of the font using additional pieces of software.

    So I’ve opted to use a list of fonts that most Japanese computers have. The code for the “h2 ” heading is below:

    h2 {font-family: 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, Osaka, 'MS Pゴシック', 'MS PGothic', sans-serif;}

    Using this code, I was able to successfully apply the font. My question is: if I want to apply that font-family to the entire site, what should the line of code read?

    Thank you!

    Kelly

    #599572

    Hey, just making sure you haven’t forgotten about me!

    Thank you again!

    Kelly

    #599851

    Hey Kelly!

    To have the fonts applied to all the elements and not just h2, try changing the h2 to body *. The code should look like:

    body * {font-family: 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, Osaka, 'MS Pゴシック', 'MS PGothic', sans-serif;}

    Let me know if that helps.

    Cheers!
    Jordan

    #601689

    Jordan,

    It worked!

    Thank you so much for your help!

    Kelly

    #601720

    Hi!

    Happy we could help you out.
    Btw, If you have a moment, I would very much appreciate if you could quickly rate our theme, which wiII heIp us keep the deveIopment.

    We really appreciate your feedback and input and again, thanks a lot for using our theme!

    Regards,
    Basilis

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Google Font’ is closed to new replies.