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

    Hi there,

    there are fonts that use a suffix of “regularitalic” for the 400 italic font. e.g.
    https://fonts.google.com/specimen/Open+Sans

    The font manager cannot handle this right now. The 400 italic is exptected to have a suffix of “-italic”.

    To fix this, I simply added:
    'regularitalic' => array( 400, 'italic' ),

    to: framework/php/font-management/class-avia-type-fonts.php
    within the init method where the $this->google_fonts_def is set.

    Deleting and instantly re-uploading / selecting the font ZIP from the library fixed the issue. The font-face CSS is generated correctly.

    Here is a hot-fix filter to fix this without changing Enfold Code:

    /* Fix for https://kriesi.at/support/topic/font-manager-handles-font-files-with-suffix-regularitalic-wrong/ */
    if ( ! function_exists( 'enfold_add_missing_google_font_filenames') ) {
    	function enfold_add_missing_google_font_filenames($enfold_font_manager_types) {
    		return array_merge($enfold_font_manager_types, array('regularitalic' => array( 400, 'italic' )));
    	}
    
    	add_filter( 'avf_google_fonts_style_definitions', 'enfold_add_missing_google_font_filenames', 10, 1 );
    }
    

    Without the fix:

    Schrift:Open Sans ( font-family: open-sans )
    normal: 300, 400, 600, 700, 800
    italic: 300, 600, 700, 800

    With the fix:

    Schrift:Open Sans ( font-family: open-sans )
    normal: 300, 400, 600, 700, 800
    italic: 300, 400, 600, 700, 800

    Best regards,

    Jan

    • This topic was modified 5 years, 2 months ago by Jan Thiel.
    #1135413

    Hey Jan,

    Thank you for sharing! :)

    Best regards,
    Victoria

    #1139137

    THANK YOU VERY MUCH !

    #1139181

    Hi,

    Did you need further help on this or shall we close this topic?

    Best regards,
    Jordan Shannon

    #1139182

    Hi @Jordan_s, as this is the fix for a bug, it would be quite nice, if you would simply ship it with the next Enfold patch ;-)

    Best,
    Jan

    • This reply was modified 5 years, 2 months ago by Jan Thiel.
    #1139189

    Hi,

    I’m sure it will be :-)

    Best regards,
    Jordan Shannon

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