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: Update editor font handling, load custom fonts for WordCamp Europe #1216

Merged
merged 5 commits into from
Jan 22, 2024

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Jan 19, 2024

This PR does a few things to the way fonts are handled in the editor:

  1. Ignore the fonts folder which is synced down from SVN, we don't need to commit it in github too (that folder will go away with GB 17.6+)
  2. Remove the Font API code which is currently throwing "Deprecated" warnings, it's not working as it should anyway
  3. Add in a workaround to load custom fonts for WordCamp Europe
  4. Re-enable loading the google fonts (the old way) on block sites - this will be a quick workaround to get WCUS's 2023 site working again.

Fixes #1203, See #1075.

The new code is in this one commit, that might be easier to review: 7b92856

Once GB 17.6 is released, we'll test that it works correctly on the WordCamp network, then remove the workaround. The user styles (what's found in the wp_global_styles post type) will probably need to be updated with the new file sources.

Screenshots

Krona One and Lora now show up in the Font Library as "theme fonts."

Screenshot 2024-01-19 at 4 21 15 PM

How to test the changes in this Pull Request:

  1. The fonts are coded to only load on WC Europe and the test site, so if you're testing locally, update the IDs in inject_fonts_theme_json.
  2. Use a block theme (2023 or 2024)
  3. View the font library in the site editor, the two fonts should be available in "Theme Fonts" - make sure they're active
  4. Edit a post or page, the fonts should be available in the Font Family dropdown
  5. Update some text to use the new fonts, it should load the fonts in the editor
  6. View the frontend, the fonts should be loading correctly

Copy link
Contributor

@StevenDufresne StevenDufresne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good solution for now. 👍

@ryelle ryelle merged commit 2acc834 into production Jan 22, 2024
3 checks passed
@ryelle ryelle deleted the fix/wordcamp-fonts branch January 22, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to add fonts to https://europe.wordcamp.org/2024/ and https://wceutest24.wordcamp.org/2024/
2 participants