- This topic has 13 replies, 3 voices, and was last updated 3 years ago by
David.
-
AuthorPosts
-
November 4, 2021 at 7:53 am #1991380
Ben
Hi,
I’ve followed this article on using local fonts. I’m trying to display 2 fonts on my Staging site, and it’s not working. One is TTNormsPro for headings, and the other is Source Sans Pro for body copy.
November 4, 2021 at 10:02 am #1991542Ying
StaffCustomer SupportHi Ben,
Can you try using a full URL in your
@font-face
CSS?The current link leads to a 404 page.
Let me know 🙂
November 5, 2021 at 2:57 am #1992294Ben
Hi Ying,
Thanks for the quick response! Are you referring to
@import
url in the@font-face
CSS?Ben
November 5, 2021 at 4:54 am #1992422David
StaffCustomer SupportHi there,
when adding local fonts DO NOT select them from the list, instead enter the font-family name in the field below, eg.
Source Sans Pro
and make sure the Google Font toggle is disabled – otherwise GP will make the google font api request instead.The other font is a custom font and you have this CSS:
@import url("//hello.myfonts.net/count/3c7913"); @font-face { font-family: 'TTNormsPro-Regular'; src: url('webFonts/TTNormsPro-Regular/font.woff2') format('woff2'), url('webFonts/TTNormsPro-Regular/font.woff') format('woff'); } @font-face { font-family: 'TTNormsPro-Bold'; src: url('webFonts/TTNormsPro-Bold/font.woff2') format('woff2'), url('webFonts/TTNormsPro-Bold/font.woff') format('woff'); }
But i don’t know why you need the @import if the fonts are stored locally and being requested ( ie. delete the above ) by this @font-face CSS
@font-face { font-family: 'TTNormsPro-Bold'; src: local('TTNormsPro-Bold'), local('TTNormsPro-Bold'), url('http://staging3.enrola.co.uk/wp-content/uploads/2020/11/TTNormsPro-Bold.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('http://staging3.enrola.co.uk/wp-content/uploads/2020/11/TTNormsPro-Bold.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ }
August 14, 2022 at 1:50 am #2312272Ben
Hi,
Thanks for the previous support. I’ve recently followed your updated Local fonts article, as I wanted to update my Source Sans Pro file now it’s a Google font, and it seemed a lot simpler with the way you handle typography on Generatepress.
I’ve followed the guidance on there, but I can’t get Source Sans Pro to display unless it’s as a Google font. I can’t see what I’m doing wrong – can you help please?
August 14, 2022 at 5:46 am #2312409David
StaffCustomer SupportHi there,
are you using the new Dynamic Typography options in the theme ? See here:
https://docs.generatepress.com/article/dynamic-typography-overview/
August 15, 2022 at 3:48 am #2313197Ben
Hi David,
Yes, that was I was trying. I’ve uploaded the fonts from the Google Helper site, added the following CSS via Simple CSS (my system wouldn’t allow True Type fonts so I excluded that line):
/* source-sans-pro-regular - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 400; src: url('http://staging3.enrola.co.uk/wp-content/uploads/2022/08/source-sans-pro-v21-latin-regular.eot'); /* IE9 Compat Modes */ src: local(''), url('http://staging3.enrola.co.uk/wp-content/uploads/2022/08/source-sans-pro-v21-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://staging3.enrola.co.uk/wp-content/uploads/2022/08/source-sans-pro-v21-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ url('http://staging3.enrola.co.uk/wp-content/uploads/2022/08/source-sans-pro-v21-latin-regular.woff') format('woff'), /* Modern Browsers */ url('http://staging3.enrola.co.uk/wp-content/uploads/2022/08/source-sans-pro-v21-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ url('http://staging3.enrola.co.uk/wp-content/uploads/2022/08/source-sans-pro-v21-latin-regular.svg#SourceSansPro') format('svg'); /* Legacy iOS */ }
I typed in Source Sans Pro as my new font in the Dynamic Typography section of Customise, and switched off Google font as the option. However, it doesn’t like it, and I can’t see what I’m doing wrong
August 15, 2022 at 6:48 am #2313336David
StaffCustomer SupportCould i get temporary admin access to the site ?
you can share the details in the Private Information field.August 15, 2022 at 7:01 am #2313349Ben
Yeah, of course.
August 15, 2022 at 8:10 am #2313553David
StaffCustomer SupportAah, ok go to Customizer > Typography -> Font Manager:
https://www.screencast.com/t/4qvIPytYed
That first font has the Google font toggle enabled. Remove that.
We probably could do a better job here, as currently if you enable it for one font it will apply to ALL google fonts.August 15, 2022 at 9:02 am #2313584Ben
I’ve switched that setting off, and it still doesn’t appear to be working.
This is a quick video showing that it is working, but not universally…
August 15, 2022 at 9:18 am #2313597David
StaffCustomer SupportYour urls in your @font-face are
http
they need to the be:https
August 15, 2022 at 12:47 pm #2313740Ben
You’re a superstar – solved it instantly. Thank you!
August 16, 2022 at 12:58 am #2314126David
StaffCustomer SupportAwesome – glad to hear that!
-
AuthorPosts
- You must be logged in to reply to this topic.