-
AuthorPosts
-
July 4, 2019 at 4:49 am #1115627
I need to upload the fonts in the Custom Font Manager, and than select the uploaded font type in the style page,
but can i just use the code provided by Google Font?for example, Google Font provides the following codes for me:
<link href="https://fonts.googleapis.com/css?family=Russo+One&display=swap&subset=cyrillic,latin-ext" rel="stylesheet">
for CSS:
font-family: 'Russo One', sans-serif;
is it possible?
July 4, 2019 at 10:54 am #1115704Hey koii123,
Yes you can do that, paste the code in your header.php file or use this in Quick CSS:
@import url('https://fonts.googleapis.com/css?family=Russo+One&display=swap');
Best regards,
RikardJuly 4, 2019 at 4:30 pm #1115831Sorry, it seems nothing happened,
I pasted the code in custom CSS,
and i cannot find the Google Font from the list in “General Styling”.Any idea?
- This reply was modified 5 years, 6 months ago by koii123.
July 5, 2019 at 9:59 am #1115986Hi,
Thank you for sharing the details.
It is not possible to generate the font list in the theme using CSS code. Please follow the steps provided in the docs to add specific fonts to the theme list.
Best regards,
VinayJuly 5, 2019 at 10:21 am #1116001after the code Rikard gave to you – the font could be used on quick css this way:
font-family: 'Russo One', sans-serif;
to register it for enfold options you can place this to child-theme functions.php :
add_filter( 'avf_google_heading_font', 'avia_add_custom_font'); add_filter( 'avf_available_google_fonts', 'avia_add_custom_font'); function avia_add_custom_font($fonts) { $fonts['Russo One'] = 'Russo+One&display=swap'; return $fonts; }
The Font is at the bottom of the list!
July 6, 2019 at 9:08 am #1116201October 15, 2019 at 12:11 pm #1148038So, suppose I would like to add a Chinese font (named “Noto Sans HK”) in my website, please kindly verify if the following is correct:
THE FIRST STEP:
infunction.php
, i added the following code:add_filter( 'avf_google_heading_font', 'avia_add_custom_font'); add_filter( 'avf_available_google_fonts', 'avia_add_custom_font'); function avia_add_custom_font($fonts) { $fonts['Noto Sans HK'] = 'Noto+Sans+HK:100,300,400,500,700,900&display=swap'; return $fonts; }
as you can see in the following picture:
THE SECOND STEP:
in Enfold > General Styling > Quick CSS, add the following code:@import url('https://fonts.googleapis.com/css?family=Noto+Sans+HK:100,300,400,500,700,900&display=swap&subset=chinese-hongkong'); font-family: 'Noto Sans HK', sans-serif;
as you can see in the following picture:
THE THIRD STEP:
after the above coding, go to: Enfold > General Styling > fonts (tab), select the new Chinese font from the lists of “Heading Font” and “Font for your body text”,is this the correct steps?
- This reply was modified 5 years, 3 months ago by koii123.
October 16, 2019 at 6:46 am #1148318 -
AuthorPosts
- You must be logged in to reply to this topic.