Tagged: font manager, italic, regular
-
AuthorPosts
-
September 6, 2019 at 4:39 pm #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+SansThe 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 theinit
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, 3 months ago by Jan Thiel.
September 7, 2019 at 5:13 pm #1135413Hey Jan,
Thank you for sharing! :)
Best regards,
VictoriaSeptember 17, 2019 at 3:29 pm #1139137THANK YOU VERY MUCH !
September 17, 2019 at 5:48 pm #1139181Hi,
Did you need further help on this or shall we close this topic?
Best regards,
Jordan ShannonSeptember 17, 2019 at 5:50 pm #1139182September 17, 2019 at 5:59 pm #1139189Hi,
I’m sure it will be :-)
Best regards,
Jordan Shannon -
AuthorPosts
- You must be logged in to reply to this topic.