WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.34k stars 4.13k forks source link

[Tracking] Font Library. Stage 2: Fonts Library extensions #53307

Closed matiasbenedetto closed 11 months ago

matiasbenedetto commented 1 year ago

Tracking issue for the Font Library. Stage 2: Google fonts collection and Font Library extensions

What ?

Add the ability to install Google fonts. Make the font library extensible providing an API to add font collections to be installed by the users.

To do:

Needs discussion

In Progress:

Dismissed

Links

Stage 1: https://github.com/WordPress/gutenberg/issues/52698 Stage 3: https://github.com/WordPress/gutenberg/issues/53926

hellofromtonya commented 1 year ago

With the Fonts Library having Google Fonts and the ability for users to upload font files, I suspect the vast majority of font needs are covered. Thus, IMO this stage should wait until there's a real need or ask from extenders to provide a way for other fonts to be presented for user consideration.

priethor commented 1 year ago

@juanmaguitar, these extensibility points would benefit from outreach & feedback with extenders. Can you put it on your radar for the next months?

matiasbenedetto commented 1 year ago

Added a PR that implements simple extensibility options to add new font collections from plugins for example. https://github.com/WordPress/gutenberg/pull/53816

I think this won't be just useful for plugins but also is a good way to standardize the way we register the font collections that are intended to be in core for example the Google one.

matiasbenedetto commented 1 year ago

With the Fonts Library having Google Fonts and the ability for users to upload font files, I suspect the vast majority of font needs are covered.

I moved the Google fonts integration to the scope of this issue for 3 main reasons:

matiasbenedetto commented 1 year ago

I created the issues regarding SVG previews and generated the previews for the Google fonts collection: https://github.com/WordPress/gutenberg/issues/54038 When we try this implementation in the frontend, we could ask meta to host the previews on wporg. We may do that now, but I think it would be useful to test this solution on the frontend first.

annezazu commented 12 months ago

@matiasbenedetto in chatting with @t-hamano, we noticed that an issue around saving happening in the background exists across both stage 2 and stage 3. IMO, this should be included in stage 2 as part of 6.4. I opened https://github.com/WordPress/gutenberg/issues/54698 and it was added to stage 3 but it's a duplicate of https://github.com/WordPress/gutenberg/issues/54601 which is listed now in stage 2. Noting here to ensure it's included for stage 2 as it's essentially the same issue :)

johnstonphilip commented 11 months ago

I think we should reconsider including Google Fonts integration in core itself. In my opinion, WordPress should provide everything needed to easily build a Google Fonts plugin (hooks, filters etc) , but not include a full Google Fonts integration directly in core.

Doing so amounts to promotion of Google, Google products, and Google trust. It's a "vote of confidence" from the WordPress project for Google. It's also free marketing for Google.

If Automattic or AwesomeMotive or Godaddy provide good font libraries, could those brands potentially be added to core as well? Or what about other kinds of assets? Is this a one-off or the beginning of brands introducing their products to WP core? This would at least set a precedent for it.

priethor commented 11 months ago

If Automattic or AwesomeMotive or Godaddy provide good font libraries, could those brands potentially be added to core as well?

Indeed! This first step includes Google as a source as a proof of concept, but following iterations can include other font providers that can be enabled/disabled through settings.

johnstonphilip commented 11 months ago

@priethor Sorry, I should have been more clear that I wasn't actually asking that. My main question is this:

Are we willing to say that the WordPress project is giving a "vote of confidence" for Google, the brand? Are we willing to provide free marketing for Google?

priethor commented 11 months ago

I personally don't think that exposing in wp-admin access to the Google fonts directory is going to have a huge impact on them marketing-wise, but I understand your concerns. 😅

In terms of "vote of confidence", the Google fonts directory is one of the largest free directories available, with a large enough infrastructure to be relied on, but in any case, it is not mandatory to use their directory: users are prompted to accept connecting to this directory, so WordPress core is letting the users decide whether they want to use (and trust) the Google directory.

Furthermore, future iterations will allow users to select which directories to use, including those coming from plugins, thanks to the Font Library's extensibility; having Google as the only source is temporary and should not be seen as an intent to promote it. 🙏

johnstonphilip commented 11 months ago

@priethor That doesn't really answer the question though.

Are we willing to say that the WordPress project is giving a "vote of confidence" for Google, the brand? Because that's what we would be doing.

Furthermore, any other brands we add to WordPress core in the future would also be getting that same "vote of confidence" from the WordPress project. Are we also willing to do it for them?

If so, how are we deciding who gets these "votes of confidence"? Is there a process a brand should go through to earn this vote of confidence? What steps should they take? When do we/they know it's enough?

Adding this opens a can of worms we don't need to open. WordPress has a plugin interface for this exact type of thing. Why not use it? This could surely be made into a plugin, right?

priethor commented 11 months ago

The reasoning behind including directories out of the box is to avoid the need to install plugins to use the functionality. Other directories will still be available through plugins but will not be a must, and the directory will still be opt-out. This reduces the friction for new users, who often find installing plugins for basic web-building stuff confusing.

Looking at this from a different angle, are there any specific concerns around this or other font directories not to include them?

johnstonphilip commented 11 months ago

@priethor I get that it's easier, today, for users and developers to just include Google. But this does open up a political set of problems that others will have to deal with in the future.

I don't think it's true that this Font Library functionality is impossible to use without a plugin. You can manually upload a font without needing a plugin, just like the media library did for years.

The media library now includes Openverse, which actually seems like a more appropriate API to pull fonts from than Google. If any integration were to live in core by default, Openverse seems like the right one.

Looking at this from a different angle, are there any specific concerns around this or other font directories not to include them?

To me this is beside the point, but I'm happy to answer. Google, specifically, doesn't have a great track record for keeping its products alive. The number of products killed by Google here is astounding: https://killedbygoogle.com/

They just sold their domains service to Squarespace, a direct competitor to the WordPress project.

In my opinion, these are reasons enough to be wary of adding Google products and branding directly to WordPress core.

annezazu commented 11 months ago

The media library now includes Openverse, which actually seems like a more appropriate API to pull fonts from than Google. If any integration were to live in core by default, Openverse seems like the right one.

Agreed! I think in the future fonts could be hosted from Openverse. Adding Google now doesn't preclude that and the same extensibility pathway Google integration is using is what other plugins/integrations can use (including Openverse). Would you be game to open up a meta ticket on that front for Openverse? I'm happy to as well.

Are we willing to say that the WordPress project is giving a "vote of confidence" for Google, the brand? Are we willing to provide free marketing for Google?

This feels like a project leadership level question on a very implementation focused thread. Would you be open to starting that discussion on a Make site perhaps? I feel that's both a better and more visible avenue to get more direction, especially with the future concerns you note. I don't want this to get lost in a GitHub thread 😬.

Separately, reading this over, it seems like part of what might help would be to iterate on this messaging to make it clearer and perhaps nudge folks more to upload manually:

Screenshot 2023-10-02 at 12 12 40 PM

To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site locally for use. If you have any concerns, you can always upload files directly from the Library tab.

That’s in line with this issue in many ways Font library: add support for detailed error messaging in API and UI.

johnstonphilip commented 11 months ago

Thanks @annezazu. I opened a ticket on Make to dicuss removing the Google Fonts integration from WordPress core, and potentially replace it with Openverse instead: https://core.trac.wordpress.org/ticket/59519#ticket

priethor commented 11 months ago

Thanks, @johnstonphilip, both for the constructive feedback and for following-up with the tickets!

Adding Openverse would indeed be the best match and is definitely something we should look forward to, although Openverse currently doesn't support fonts and depends on Openverse's roadmap and capacity.

To add on top to what Anne said, it's worth noting that in the event Google ceased to support the directory (as you pointed out, the track record is there! 😅 ), it would not affect sites that used it at all, as once downloaded, fonts are served to the users locally.

johnstonphilip commented 11 months ago

Agree, and yeah I agree. I'm not concerned about this breaking, and none of my concerns here are technical. Rather, they are political (I think that's the word), or philosophical in nature. So maybe it's best to shift this part of the conversation to the make ticket so ya'll can stay focused on the technical here. Thanks for the productive conversation!

azaozz commented 11 months ago

@johnstonphilip

Are we willing to say that the WordPress project is giving a "vote of confidence" for Google, the brand? Because that's what we would be doing.

Furthermore, any other brands we add to WordPress core in the future would also be getting that same "vote of confidence" from the WordPress project. Are we also willing to do it for them?

If so, how are we deciding who gets these "votes of confidence"?

Sorry but seems I may be missing something? Out of the box WordPress supports content (embeds) from several providers/sites: YouTube, Dailymotion, Vimeo, TikTok, Twitter, Reddit, Speaker Deck, TED, etc. etc. The full list can be seen here: https://github.com/WordPress/wordpress-develop/blob/6.3.1/src/wp-includes/class-wp-oembed.php#L53.

How is loading fonts from a Google CDN or mentioning "Google" in that respect any different? :)

johnstonphilip commented 11 months ago

@azaozz I suppose not much is different there, which means they also fit into my questions. I can see that those would also apply to everything I've said. If I started my own video sharing website, what would it take for me to get a dedicated block into WP core? What is the threshold those services met to get dedicated blocks into WP core? Those should probably be part of this conversation I guess.

Is the fact that it's never been a problem mean it never will be a problem and we should ignore it? Maybe. Maybe it has been a problem and we just aren't aware? Maybe we should all just ignore these kinds of things? Thoughts?

johnstonphilip commented 11 months ago

@azaozz I added a comment to the trac ticket about your question so we can continue the conversation over there :)

matiasbenedetto commented 11 months ago

I'm closing this issue because this stage was part of the plan to make the font library ready to merge in WordPress core 6.4, but since it was punted to 6.5, we should focus on making it ready for 6.5. This is the new tracking issue: https://github.com/WordPress/gutenberg/issues/55277