Tagged: google fonts
-
AuthorPosts
-
March 3, 2016 at 6:02 am #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-jpanBut 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
March 4, 2016 at 7:09 am #593135Hi 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,
RikardMarch 5, 2016 at 2:46 am #593607Rikard,
Thank you!
Kelly
March 7, 2016 at 2:36 pm #594320Hi!
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 KashyapMarch 8, 2016 at 3:45 am #594735Vinay,
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
March 8, 2016 at 11:46 am #594946Hey!
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 KashyapMarch 9, 2016 at 12:30 pm #595514Vinay,
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
March 9, 2016 at 1:38 pm #595547Hey!
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 KashyapMarch 15, 2016 at 12:07 pm #598321Vinay,
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
March 17, 2016 at 1:20 pm #599572Hey, just making sure you haven’t forgotten about me!
Thank you again!
Kelly
March 17, 2016 at 6:13 pm #599851Hey 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!
JordanMarch 22, 2016 at 6:18 am #601689Jordan,
It worked!
Thank you so much for your help!
Kelly
March 22, 2016 at 7:48 am #601720Hi!
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 -
AuthorPosts
- The topic ‘Google Font’ is closed to new replies.