- This topic has 9 replies, 4 voices, and was last updated 3 years, 5 months ago by David.
-
AuthorPosts
-
October 24, 2020 at 8:40 am #1502544Heinrich
hi team,
i have added a local google font – josefin sans – and it`s working fine. in the same way i added a non google font – freehand575bt-regularb – and its not working as expected. any idea?
php i use:
add_filter( ‘generate_typography_default_fonts’, function( $fonts ) {
$fonts[] = ‘Josefin Sans’;
$fonts[] = ‘freehand575bt regularb’;return $fonts;
} );css i use:
@font-face {
font-family: ‘freehand_575btregular’;
src: url(‘http://haaslm.temp513.kinsta.cloud/wp-content/fonts/freehand575bt-regularb.eot’);
src: url(‘http://haaslm.temp513.kinsta.cloud/wp-content/fonts/freehand575bt-regularb.eot?#iefix’) format(’embedded-opentype’),
url(‘http://haaslm.temp513.kinsta.cloud/wp-content/fonts/freehand575bt-regularb.woff2’) format(‘woff2’),
url(‘http://haaslm.temp513.kinsta.cloud/wp-content/fonts/freehand575bt-regularb.woff’) format(‘woff’),
url(‘http://haaslm.temp513.kinsta.cloud/wp-content/fonts/freehand575bt-regularb.ttf’) format(‘truetype’),
url(‘http://haaslm.temp513.kinsta.cloud/wp-content/fonts/freehand575bt-regularb.svg#freehand_575regular’) format(‘svg’);
font-weight: normal;
font-style: normal;October 24, 2020 at 10:00 am #1502615DavidStaffCustomer SupportHi there,
in the PHP filter make sure that the font name matches the font-family in your @font-face CSS
Here you have a space:
$fonts[] = ‘freehand575bt regularb’;
Whereas here you do not:
font-family: ‘freehand_575btregular’;
Update the
$fonts[]
value.October 24, 2020 at 1:21 pm #1502767Heinrichhi david, tks for quick reply. in customizer i can choose, but no impact on frontend…
October 25, 2020 at 11:55 am #1503813TomLead DeveloperLead DeveloperHi there,
Did you make the change that David suggested?
If so, can you link us to your website so we can see why it’s not working?
Thanks!
October 25, 2020 at 5:13 pm #1503999Heinrichhi tom, of course. credentials are in the private box.
October 25, 2020 at 8:03 pm #1504049ElvinStaffCustomer SupportHi,
You can try David’s reply AND disable autoptimize plugin to see if it works.
Perhaps this is a simple caching issue.
Let us know how it goes.
October 26, 2020 at 2:07 am #1504256Heinrichhi elvin,
clearing cache is part of the game every minute…..or as your wise man says .-)same effect without autoptimize and clearing server-side cache and wp–cache….you have the login credentials, would appreciate you`ll have a look?
tks in advance
October 26, 2020 at 2:39 am #1504291DavidStaffCustomer SupportTry changing:
$fonts[] = ‘freehand575btregularb’;
to
$fonts[] = 'freehand575bt-regularb';
Make sure none of your code has curly quotes ie.
‘
they need to be'
October 26, 2020 at 3:53 am #1504368Heinrichhi david, is working, tks for help
October 26, 2020 at 4:45 am #1504423DavidStaffCustomer SupportGlad to hear that!
-
AuthorPosts
- You must be logged in to reply to this topic.