Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts file format #113

Open
JohnPixle opened this issue Feb 6, 2024 · 5 comments
Open

Fonts file format #113

JohnPixle opened this issue Feb 6, 2024 · 5 comments
Labels
customer report Indicates the request came from a customer.

Comments

@JohnPixle
Copy link
Contributor

hey @HardeepAsrani can you review this comment on the Neve FSE repo?

https://wordpress.org/support/topic/its-fantastic-so-far-except-in-the-fonts/

If it makes sense, I am ok with using the .woff2 file, BUT when I download a font file from google, I only see the ttf version.

let me know your thoughts!

Screenshot 2024-02-06 at 1 44 09 PM

@pirate-bot pirate-bot added the customer report Indicates the request came from a customer. label Feb 6, 2024
@HardeepAsrani
Copy link
Member

@JohnPixle I was looking into it but Google Fonts doesn't give you the woff or woff2 file of any fonts directly. There are two ways to go about it:

  1. If you select a font from their website and visit the URL, you should be able to find the source files here: http://fonts.googleapis.com/css?family=Open+Sans - it should be woff on Firefox, and woff2 when using Chrome.
  2. I tried for free fonts from Google Fonts and was easily about to download woff2 files from other sources by searching. I'm not sure if that's the case for all the files but at least I was able to find the famous ones.

Let me know what you think.

@JohnPixle
Copy link
Contributor Author

@HardeepAsrani I think I found a better UI to help us get the WOFF fonts 😄 :

https://gwfh.mranftl.com/fonts

Regarding compatibility, I see the WOFF and WOFF2 file formats is safe: https://caniuse.com/woff

Do we need to include both file formats? I don't think so, right?
WOFF 2 is supposed to be 30% lower in file size.

I can collect the fonts in your suggested format and share them here, and if you can replace them in the theme it would be great.

Let me know your thoughts!

@JohnPixle
Copy link
Contributor Author

@HardeepAsrani

I managed to get all the variable weight fonts that we use in the theme as WOFF2 through this site.

Original size of the fonts folder was 5.7 MB
New size is 2.6 MB

I have the families in the zip below, you should be able to replace them in the theme code.
I guess the font file names in theme.json will also need to be replaced after we replace the files. . .

Let me know if you need further help!

fonts.zip

@JohnPixle
Copy link
Contributor Author

Given the latest updates on WP with google fonts, I am not sure i we need to further pursue this.
Maybe, if there is a safe fallback we can provide, we can remove our font files from the code? Needs a bit of discussion... 🤔 Any insights @HardeepAsrani ?

Screenshot 2024-04-03 at 9 33 26 AM

@HardeepAsrani
Copy link
Member

@JohnPixle We can simply register them like this: https://make.wordpress.org/core/2024/03/14/new-feature-font-library/

Which might be nice but we need to keep in mind that the Font Library works for latest WP version only and not for older versions where we still need to have the Fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer report Indicates the request came from a customer.
Projects
None yet
Development

No branches or pull requests

3 participants