Archived topic
Google fonts local instance
6 replies · Started by Stephan on April 10, 2021
Hi Guys,
following your tutorial for hosting google fonts localy since hours.
i uploaded my desired font, but when adding the code from "google webfonts helper" as a snippet my site breaks instantly. no chance to enter backend - everytime i have to debug the snippet via config-file... very frustating :-)
i am using this code:
`/* source-sans-pro-regular - latin */
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: url('https://xn--hgelhelden-9db.de/wp-content/uploads/fonts/source-sans-pro-v14-latin-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('https://xn--hgelhelden-9db.de/wp-content/uploads/fonts/source-sans-pro-v14-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('https://xn--hgelhelden-9db.de/wp-content/uploads/fonts/source-sans-pro-v14-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('https://xn--hgelhelden-9db.de/wp-content/uploads/fonts/source-sans-pro-v14-latin-regular.woff') format('woff'), /* Modern Browsers */
url('https://xn--hgelhelden-9db.de/wp-content/uploads/fonts/source-sans-pro-v14-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('https://xn--hgelhelden-9db.de/wp-content/uploads/fonts/source-sans-pro-v14-latin-regular.svg#SourceSansPro') format('svg'); /* Legacy iOS */
}
i can not figure out, what i am doing wrong.
can you help me out?
Thanks in advance
kind regards
Stephan

Hi there
that code is CSS - you should add it to your child themes style sheet or in the Customizer > Additional CSS.
Oh David,
that is so embarrassing...sorry for my awkward question.. :-)
of course... now it works...
Thank you very much
By the way: Is there a way to test / verify that i am using my google font now locally without a server connection to google?
Glad to hear that.
I just checked the site and i can confirm the only font being loaded is Source Sans Pro and it is from your local server.
To check Right Click > Inspect the page to open the developers tools. Go to the Network Tab and select Fonts. You will see the font loading there.
You can also change the Customizer > General --> Icon Type to SVG to eliminate the generatepress.woff file for the icons.
Thank you for your quick and, as always, highly professional help
You're welcome