Local Fonts Error - Fonts not uploading to site
Hi there,
When trying to use Google fonts locally like this:
What we get is that the fonts folder is created propery, and the file mfn-local-fonts.css is also ok
But the files are empty... all font files have zero content and zero file size... they are empty
We used MIME plugins like this one and nothing happened anyways
Please advise....
Thanks!
PS: For the next release, we would suggest downloading a zip file locally to my computer so that we can upload it via FTP to the server
Comments
Hello,
Most likely, your server blocks the file_get_contents function, and fonts cannot download correctly.
Please, contact your server administrator to resolve that problem.
Best regards
But the file mfn-local-fonts.css is properly uploaded
And the folders are created and the files are uploaded, but it seems that only the woff2 files are empty
Nonetheless did you contact your server administrator?
If not, please, do that.
Thanks
We decided to solve it on our side, regenerating the fonts files and the css ourselves and uploading them to the ftp
This is how we did it: (an example for Lato)
https://gwfh.mranftl.com/fonts/lato?subsets=latin
Then we copied and pasted all the css generated for all the fonts needed replacing the content of the file mfn-local-fonts.css in /uploads/betheme/fonts/
Interesting article:
https://www.aleksandrhovhannisyan.com/blog/downloading-and-optimizing-google-fonts/#2-downloading-woff2s-directly-from-googles-servers
Your "automated" solution did not work for us. No matter what we did, the woff2 files were empty
Thanks anyways
Great to see that manage that.
However, can you tell me if you contact your hosting provider?
If yes, can you tell me what he told you?
Best regards