Install google font 'Lato' locally

Hey David,

I checked your page and your Custom Lato font works.

The Font Manager Custom Fonts recommends woff or woff2 so that means you can install them if your server only allows it. Most web hosts do.

If you can’t upload woff or woff2, it is a problem with your web host. If uploading a woff font is important, you will need to move to a host that supports uploading woff.

Thanks.

Hi,

Yes, it works, but I was just able to select ttf files, not woff and woff2 files. When I upload them using the font manager, they are uploaded but are not listed in the list of selectable files. So it can’t be a host problem, can it? You can try installing a woff file and you can see what happens on my customizer.

Sorry for the confusion. I tried different web hosts and found that it’s WordPress that won’t accept woff just like SVG. I’ll post this in our issue tracker to remove woff and woff2 recommendation to avoid confusion.

I’m sorry It turns out that you currently could only use TTF in the Font Manager. If you need to use woff, the @font-face method would be the current solution. Regretfully, you will need to use custom CSS everytime you’ll set a font-family with V2 Elements.

Thanks.

UPDATE: It looks like it’s a combination of server and WordPress setup that permits a file format to be uploaded. In one of my test sites for instance, even TTF was not accepted.

I was able to use WOFF and WOFF2 in my test site via the method below.

  1. Upload the font files in your web server preferably the uploads folder.
  2. Install the Add From Server
  3. Add the font files to your Media Gallery
  4. Once available in the Media Gallery, you will be able to choose the woff and woff2 font formats.

Hope that helps.

Hi, thank you very much for your helpful reply. I added the font files to the media library using “Add From Server” (eot, woff and woff2 files), but I only could see ttf and (finally!) woff2 files. I could not see woff and eot listed. Do you think ttf and woff2 is enough for cross browser compatibility?

woff2 won’t work in IE. See https://caniuse.com/#search=woff2

woff will. See https://caniuse.com/#search=woff

ttf is better than woff2. See https://caniuse.com/#search=ttf

I’m not sure why it’s not listed though. There could be a conflict somewhere specific in your setup. You can try reloading or repeat the whole process again. If it will not work, I’d recommend that you test out other web hosts.

Thanks.

Hi,

OK, now I can install woff2, woff and ttf.
There was a reply above that said I should add a function called add_custom_upload_mimes() to my child theme’s functions.php. It was still there, so I removed it and I can now use woff as well.
Thank you very much for all your replys!

Just in case someone accesses my site from a really old browser, because eot and svg are missing, can I set a fallback font somewhere in the customizer? What is the default fallback font in x theme? Something sans serif?
If it is not possible, it is allright as well. I am happy now.

Hi David,

Yes, the fall back will be the combination of these Helvetica,Arial,sans-serif. The fall back should always be a system font since the custom one needs a download time before it can render.

Thanks!

All right! Many thanks!

You’re welcome! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.