Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1363389

    is there a way to do this?
    because i uploaded a Cormorant Infant Font – but Enfold set it for only sans serif fonts ( Helvetica, Arial, sans-serif)

    do i have to go manually over my quick css by:

    body.open-sans {
     font-family:'open-sans',Helvetica,Arial,sans-serif;
    }
    
    h1, h2, h3, h4, h5, h6,
    #top .title_container .main-title,
    #top .portfolio-title,
    .callout .content-area,
    .avia-big-box .avia-innerbox,
    .av-special-font,
    .av-current-sort-title,
    .html_elegant-blog #top .minor-meta,
    tr.pricing-row td,
    #av-burger-menu-ul li {
     font-family:'cormorant-infant',Times New Roman, Georgia, serif;
    }
    #1363437

    Hey Guenter,

    Thank you for the inquiry.

    You can use the avf_fallback_fonts_array filter to define your own fallback fonts, defaults to 'Helvetica', 'Arial', 'sans-serif'.

    add_filter('avf_fallback_fonts_array', function($fallback, $selected_font_family) {
        $default_font = avia_get_option( 'default_font' );
        $google_font = avia_get_option( 'google_webfont' );
    
        return array(
            'Helvetica',
            'Arial',
            'sans-serif'
        );
    }, 10, 2);
    

    Defined on enfold/framework/php/class-style-generator.php file.

    Best regards,
    Ismael

    #1363438

    Thats cool – but how to differ if i had for headings a serif font and for body a sans-serif?

    #1363443

    Hi!’

    You can create a few conditions based on the $selected_font_family, $google_font (‘Heading Font’) and $default_font (‘Body Font’).

    Example:

    $stroke =  $google_font == 'Open Sans' ? 'sans-serif' : 'serif';
    return array(
            'Helvetica',
            'Arial',
            $stroke
        );
    

    Regards,
    Ismael

    #1363607

    yes – can be closed -thanks

    #1363620

    Hi,

    We are glad that Ismael could help!

    Let us know if you have any other questions and enjoy your weekend :)

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘how to determine fallback font for custom uploaded fonts’ is closed to new replies.