-
AuthorPosts
-
March 24, 2014 at 1:31 pm #242044
Hi Kriesi,
Thanks for the wonderful theme.How can the Open Sans font be hosted and called from my website without having to call the Google API?
<!– google webfont font replacement –>
<link id=”google_webfont_1″ rel=”stylesheet” type=”text/css” href=”http://fonts.googleapis.com/css?family=Open+Sans:400,600″ />This is an open source font which I want to host on my own website instead.
Thanks
March 25, 2014 at 6:24 am #242533Hey anfinnweb!
You can download the font face kit here: http://www.fontsquirrel.com/fonts/open-sans
Add the font using font face: http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp
Regards,
IsmaelMarch 25, 2014 at 10:26 am #242623Hi Ismael,
Thanks for the quick support.I have downloaded the font files and uploaded them to a /fonts/ directory and also added the following to the Quick CSS but the fonts are not loading:
@font-face {
font-family: “Open Sans”;
font-style: normal;
font-weight: 600;
src: local(“Open Sans Semibold”), local(“OpenSans-Semibold”), url(“http://websitename.com/wordp/wp-content/themes/enfold/fonts/OpenSans-Semibold.ttf”) format(“ttf”);
}
@font-face {
font-family: “Open Sans”;
font-style: normal;
font-weight: 400;
src: local(“Open Sans”), local(“OpenSans”), url(“http://websitename.com/wordp/wp-content/themes/enfold/fonts/OpenSans-Regular.ttf”) format(“ttf”);
}What is still required to make the fonts load and no longer call or show the Google Fonts in the Source Code?
Thanks
March 25, 2014 at 5:30 pm #242866March 26, 2014 at 12:33 am #243072Hello Yigit,
Thanks for the link but your instructions and solution are completely different to Ismael’s.All I want to do is not call Google Fonts for anything, host the fonts on my website and then use these fonts for the website (Open Sans Regular & Open Sans Semibold)???
Hasn’t this been done in the past by other people using Enfold?
March 27, 2014 at 6:38 pm #243998Hey!
While yes it has been done it isn’t really in the realm of what we cover through support. If using @font-face isn’t working for you can try asking on stack overflow, or as Yigit suggested using a plugin which takes the heavy lifting out of your hands.
The issue you are probably running into is that once you stop telling the theme to use the google font it is no longer selected in the css. So even if you are correctly loading in the font it isn’t styled. The font-face rules need to have accompanying css rules to then style your font as well.
Cheers!
DevinMarch 29, 2014 at 3:49 am #244667Hey Devin,
Ok, thanks for the help. I’ll look at the plugin again and maybe try stack overflow.You can close this ticket if you like.
Thanks
-
AuthorPosts
- The topic ‘Google Font Replacement’ is closed to new replies.