Making WordPress.org

Opened 3 months ago

Last modified 2 months ago

#7282 new defect (bug)

Host SVG image previews and JSON collection data for Google Fonts listed in the Font Library

Reported by: mmaattiiaass's profile mmaattiiaass Owned by:
Milestone: Priority: high
Component: General Keywords:
Cc:

Description

In the new Font Library that will be introduced in WordPress 6.4, we display a list of Google fonts. For performance reasons, instead of loading the full font assets to create the font previews, we are rendering a custom pre-generated SVG image with the preview. We would need to host those images somewhere. It would be useful to host that in wporg CDN.

The SVG previews are currently hosted on this repo:https://github.com/WordPress/google-fonts-to-wordpress-collection specifically in the /output/preview folder.

We would need to host them to access them from the frontend of the Font Library, you can try that in action on this Playground link: https://shorturl.at/alpHP

This is the PR where this is being implemented: https://github.com/WordPress/gutenberg/pull/54566

In summary:

What?
Host on wpoorg CDN, maintaining the same folders tree, the SVG files from /output/preview of the repo mentioned.

Why?
To load font previews fast in the new WordPress Font Library.

Change History (9)

#1 @tobifjellner
3 months ago

Ehm. What about localization?

  1. I hope that someone using a language with non-Latin script will have possibility to filter for fonts that support the target script. (But that would be off-topic for this meta ticket, though.)
  2. Meta side: Would we have a way to pre-generate previews that use the relevant script? So on a site that uses Russian, the preview would show some Cyrillic text? (Perhaps alongside some Latin text...)

This ticket was mentioned in Slack in #meta by courtneyengle. View the logs.


3 months ago

#3 @Clorith
3 months ago

Curious, but by hosting these, and loading them from WordPress.org, are we not just shifting the tracking concern off Google's services and onto WordPress' services instead?

There's a warning that you are allowing access between Google Fonts and your site, but not dotorg.

There are some gray areas that allow for update systems etc, but this isn't an update system, so I think we need to be aware of that as well, the emoji thing is already contentious in some privacy-oriented areas, and if this is another thing that gets blocked, how will users get previews?

#4 @azaozz
3 months ago

re we not just shifting the tracking concern off Google's services and onto WordPress' services instead?

Yes, it may look that way, but this is only for logged-in users that have capability to install fonts. This type of users (site admins) do access w.org sometimes, for example when viewing the About screen, when looking at plugins or themes to install, etc. And yes, this is the way emoji images work too.

I don't think loading the font preview images deviate from the existing use cases. This more or less matches how plugins and themes are installed, and w.org is accessed to get the info/images for them, and to download the zips.

if this is another thing that gets blocked, how will users get previews?

I think that if this gets blocked the users will simply not get previews. Seems they will have to preview the fonts somewhere else, download the files and install "manually". Whether that would respect their privacy better is another question...

Last edited 3 months ago by azaozz (previous) (diff)

#5 @jeffikus
3 months ago

Update: This PR is now merged https://github.com/WordPress/gutenberg/pull/54566

Please can you proceed and commit the SVG image files that you can find in this path - https://github.com/WordPress/google-fonts-to-wordpress-collection/tree/main/output/previews - to the .org CDN?

Version this with 16.7 to match the GB release in the url. Please maintain the folder structure within - /font-slug/filename.svg

In addition, please add the google-fonts-with-previews.json file - https://raw.githubusercontent.com/WordPress/google-fonts-to-wordpress-collection/main/output/google-fonts-with-previews.json - to the CDN, using the same versioning as the svg image files, this can be found in the /output/ folder.

The main repo for the files is found at https://github.com/WordPress/google-fonts-to-wordpress-collection/

This needs to be completed by the WP 6.4 Beta 1 release on Tuesday as this is being done alongside the Font Library trac ticket here https://core.trac.wordpress.org/ticket/59166

#6 @jeffikus
3 months ago

If we need to update any of the SVG files or the json file, should we use versioning to match WP core instead of the GB version numbers?

This ticket was mentioned in Slack in #meta by sereedmedia. View the logs.


2 months ago

#9 @ironprogrammer
2 months ago

  • Summary changed from Host SVG image previews for Google Fonts listed in the Font Library to Host SVG image previews and JSON collection data for Google Fonts listed in the Font Library

Updated title to include hosting of default collection data JSON.

Note: See TracTickets for help on using tickets.