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

Update webfonts.php #1303

Closed
hellor0bot opened this issue Apr 25, 2017 · 9 comments
Closed

Update webfonts.php #1303

hellor0bot opened this issue Apr 25, 2017 · 9 comments
Milestone

Comments

@hellor0bot
Copy link

Issue description:

The current webfonts.php file is outdated.

Could you please update it, so that it includes the latest Google Fonts?

Thank you!

Version used:

Develop branch.

@aristath
Copy link
Contributor

Done.
It's updated automatically if you run grunt googlefonts, but now I also added it to the default grunt task so it will run more often 👍

@hellor0bot
Copy link
Author

hellor0bot commented Apr 26, 2017

Thanks a lot, @aristath.
Please don't forget to update \core\class-kirki-fonts.php. Seems that Google Fonts replaced 600bold with 600, etc.

@aristath
Copy link
Contributor

Should be ok now 👍

@hellor0bot
Copy link
Author

Just tested it. Seems that Google Fonts are not enqueued on the front-end. The backend (customizer view) works fine though.

@aristath aristath reopened this Apr 27, 2017
@aristath
Copy link
Contributor

Reopened, I'll check into it later today.
Thanks for checking!

@aristath
Copy link
Contributor

aristath commented Apr 27, 2017

@hellor0bot by "Not enqueued" what exactly do you mean?
You mean that you can't find the link to the googlefonts in the page's source?
Or that the fonts don't work?
In all my tests, the fonts seem to be working fine.
HOWEVER, if you look at the source there's no more inline styles, and no more google-fonts link enqueued.

As recommended on https://modpagespeed.com/doc/filter-css-inline-google-fonts googlefonts should be added inline instead of enqueued. It's 1 less request on the browser, and it just makes sense...

So in version 3 we attempt to get the contents of the googlefonts URL (which is built just like before). If the body of that request is retrieved successfully, then it is added to the kirki styles (and slightly minified too).
Then we try to create a file in wp-content/uploads/kirki-css/styles.css.
If the file can be created using the WordPress filesystem, then the CSS is written to that file, including the googlefonts styles.
If the file for some reason can't be created (file/folder permissions issues, weird server configurations or using an FS_METHOD other than direct can cause this) then the CSS is added inline just like before.

So... no matter how the code looks, do the fonts work? Can you see the selected fonts properly rendered in the frontend?

@hellor0bot
Copy link
Author

Sorry, I can't test it again right at the moment (reverted to an older develop branch), but the Google Fonts didn't work on the front end (were not rendered).

@aristath aristath modified the milestone: 3.0 Apr 27, 2017
@Micemade
Copy link

Micemade commented May 3, 2017

How about update in wp.org repository (for us, the mortals ... :) ) ?
I noticed many fonts are updated in fonts.google repository ( for example, "Montserrat" has from 100 to 900 weights, with italics, and in Kirki has two only weights 400,700 )
... (pretty please ) ...

@aristath
Copy link
Contributor

@Micemade 3.0 is close, patience... 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants