- This topic has 11 replies, 2 voices, and was last updated 6 years, 4 months ago by
Tom.
-
AuthorPosts
-
December 5, 2019 at 12:06 pm #1094993
Moira Ashleigh
In this article https://docs.generatepress.com/article/adding-local-fonts/#uploading-our-font it said I could FTP the font to the child site – which I did, but after that point the instructions only completed information for working with Google fonts. So I am at the stage of having the font in the child site folder, but what exactly is next? I assume add it to the CSS but I cannot use the Google CSS, since it is not a google font. The font ( I know the font is a client desire ) is at …/wp-content/themes/generatepress_child/fonts/DevinneSwash.ttf
So add this to the CSS?
@font-face {
font-family: “Devinne Swash”;
src: url(“https://aaa.aaaa.com/wp-content/themes/generatepress_child/fonts/DevinneSwash.ttf “);
}yes this is still in staging and much to be done…and once it goes live 3 web URL will point to this one website, so will that mess this up? I assume I will have to change the URL pointer by hand upon going live. :\
Thanks
MDecember 5, 2019 at 8:11 pm #1095318Tom
Lead DeveloperLead DeveloperHi there,
So add this to the CSS?
@font-face {
font-family: “Devinne Swash”;
src: url(“https://aaa.aaaa.com/wp-content/themes/generatepress_child/fonts/DevinneSwash.ttf “);
}That’s correct. If the URL changes when the site goes live, you will need to update the URL.
If the CSS exists in the
generatepress_childfolder, you can do this instead:@font-face { font-family: “Devinne Swash”; src: url("fonts/DevinneSwash.ttf"); }December 12, 2019 at 3:26 pm #1102674Moira Ashleigh
I tried both ways on this using the Generate Press child CSS in the theme editor – neither one worked. :\
December 12, 2019 at 4:53 pm #1102719Tom
Lead DeveloperLead DeveloperDoes the
fontsfolder exist in the child theme as well?Looking at your child theme CSS, the
"characters are messed up. Can you try replacing them with typed"characters?December 12, 2019 at 5:10 pm #1102725Moira Ashleigh
I did that and no change. 😐
MDecember 12, 2019 at 5:28 pm #1102736Tom
Lead DeveloperLead DeveloperAre we sure the file exists in that location? I’m getting a 404 when I try it:
http://yourURL.com/wp-content/themes/generatepress_child/fonts/DevinneSwash.ttfDecember 12, 2019 at 5:41 pm #1102739Moira Ashleigh

So this is the file manager and the woolcloaks folder is pointing to woolcloaks.medeivalweddings.com for the staging work.
December 13, 2019 at 9:08 am #1103453Tom
Lead DeveloperLead DeveloperWhen you put the URL to your font in your address bar, does it download the font or go to a 404?
If it goes to a 404 and you’re sure the file exists, you might need to report it to your hosting to see if they can spot what’s going on.
December 18, 2019 at 8:09 am #1107918Moira Ashleigh
so that was interesting, and yes it was not downloading, and host said no ttfs said I needed to turn it into a webfont via Squirrelfonts – done. But the host and I both missed there are 2, count them, 2 versions of the main folder smh – it now downloads just fine.
I have added the CSS in, it finally shows in the CSS in the File Manager, but does not show up in the Customizer. Do I need to add an action in the functions.php for this to show?
@font-face {
font-family: devinne_swashregular;
src: url(http://xxx.xxx.xxx/wp-content/themes/generatepress_child/fonts/devinneswash-webfont.woff2);
src: url(http://xxx.xxx.xxx/wp-content/themes/generatepress_child/fonts/devinneswash-webfont.woff);
font-weight: normal;
}December 18, 2019 at 5:40 pm #1108338Tom
Lead DeveloperLead DeveloperAwesome. Now you need to do this part: https://docs.generatepress.com/article/adding-local-fonts/#adding-it-to-the-customizer
add_filter( 'generate_typography_default_fonts', function( $fonts ) { $fonts[] = 'devinne_swashregular'; return $fonts; } );December 19, 2019 at 9:40 am #1108994Moira Ashleigh
Yay!!! Thank you
Happy Holidays!December 19, 2019 at 6:53 pm #1109322Tom
Lead DeveloperLead DeveloperYou’re welcome! Happy Holidays 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.