Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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?

    #1115704

    Hey 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,
    Rikard

    #1115831

    Sorry, 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.
    #1115986

    Hi,

    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,
    Vinay

    #1116001

    after 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!

    #1116201

    Hi,

    Thanks for helping out @Guenni007, it’s much appreciated :-)

    Best regards,
    Rikard

    #1148038

    So, 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:
    in function.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:
    function.php

    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:
    Enfold CSS section

    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.
    #1148318

    Hi,

    Thanks for the update. Does the font show up under the fonts tab? If so then it should be correct. If the font is imported correctly then you should be able to remove the CSS you added in Quick CSS.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.