- This topic has 27 replies, 5 voices, and was last updated 6 years, 1 month ago by
Tom.
-
AuthorPosts
-
January 13, 2019 at 4:17 am #780525
David
StaffCustomer SupportThe syntax should look like this
@font-face { font-family: 'MyWebFont'; src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('webfont.woff2') format('woff2'), /* Super Modern Browsers */ url('webfont.woff') format('woff'), /* Pretty Modern Browsers */ url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */ url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */ }I.E each of the URLs are comma separated.
January 13, 2019 at 7:37 am #780724dgainesj
Thank you David! I fixed those commas, and the custom font is still not appearing…
Anything else to try?
Thanks!
DinaJanuary 13, 2019 at 9:28 am #780785Tom
Lead DeveloperLead DeveloperAny chance you can send us temporary admin login details so we can take a quick look?: https://generatepress.com/contact
If so, be sure to mention this topic.
Thanks!
February 23, 2020 at 1:15 am #1174127dgainesj
Hi it’s me again with another custom font question…
Or rather, the same custom font question… sorry I still don’t seem to get it 🙁So, the site is:
http://sifrei-meir-panim.com/I am trying to add the Hebrew font Vilna to the customizer.
I only have a ttf file for this font, not the other files. Could that be the issue? The thing is, the custom font does show up in the Elementor fonts list with only that single file, so I hope we can work out the customizer as well.
Here’s what I did:
>> I uploaded the ttf file to the custom fonts section of Elementor. It now is also in the media files.
>> I put this code in Simple CSS:
@font-face {
font-family: ‘Vilna’;
src:url(‘http://sifrei-meir-panim.com/wp-content/uploads/2020/02/Vilna.ttf’) format(‘truetype’);>> I put this code in Code Snippets:
add_filter( ‘generate_typography_default_fonts’,’tu_add_system_fonts’ );
function tu_add_system_fonts( $fonts ) {
$fonts[] = ‘Vilna’;
return $fonts;
}That’s it, correct? It should now appear in the customizer? But it doesn’t. I know it is something I keep on doing or not doing.
Thanks for your help!
DinaFebruary 23, 2020 at 9:24 am #1174520Tom
Lead DeveloperLead DeveloperThe second code in Code Snippets should make it appear at the bottom of the “System fonts” section on your font family selects in the Customizer. If it’s not there, make sure all caches (plugins, server etc..) have been cleared.
Also, your first CSS snippet is missing the closing
}character.Let me know 🙂
February 23, 2020 at 12:03 pm #1174612dgainesj
Hi Tom,
I cleared the cache (in chrome and with super cache plugin) and I fixed that bracket. Still no Vilna font.
Thoughts??? Or maybe there’s a custom font curse that floats around and zaps me????
Thanks!
DinaFebruary 23, 2020 at 6:20 pm #1174774Tom
Lead DeveloperLead DeveloperDid you end up sending me temporary login details? Any chance you can re-send them?: https://generatepress.com/contact
Let me know 🙂
February 23, 2020 at 10:01 pm #1174839dgainesj
Thank you!
DinaFebruary 24, 2020 at 9:24 am #1175475Tom
Lead DeveloperLead DeveloperIn your Code Snippet, try replacing all of the
’characters with'.See how one is curly and the other is straight? I believe that’s the issue.
Alternatively, just replace the function with this:
add_filter( 'generate_typography_default_fonts', 'tu_add_system_fonts' ); function tu_add_system_fonts( $fonts ) { $fonts[] = 'Vilna'; return $fonts; }February 24, 2020 at 9:34 pm #1175890dgainesj
It works now thank you thank you thank you!
For the life of me I wouldn’t have been able to see that!
You are seriously the best.
February 25, 2020 at 10:37 am #1176614Tom
Lead DeveloperLead DeveloperGlad I could help! 🙂
March 2, 2020 at 6:04 am #1182150Daniel
Hello My friends
When I use the method in this article (https://docs.generatepress.com/article/adding-local-fonts/), Custom fonts are added to customizer settings. Everything is OK.
But
Could you please give me a function that I can add it to child-theme functions.php so that my custom fonts would also be seen in Elementor typography options?? Is it possible??
Thanks a lotMarch 2, 2020 at 8:26 am #1182473Tom
Lead DeveloperLead DeveloperHi there,
I’m not sure what filter would be required to add them to Elementor. You may need to check with their support.
-
AuthorPosts
- You must be logged in to reply to this topic.