-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Font Library: Export fonts on theme export #54226
Comments
I am not sure if we should do this. I think my preference is to enhance Create Block Theme to handle it: WordPress/create-block-theme#451. Font Library is designed so that installed fonts are treated more like Media and are theme agnostic — hence the default install location is in Also a font face src can be a remote host — how would we know when to move the font to the theme assets and rewrite the src, vs leaving the src untouched? We could perform a string comparison to see if the src contains the domain of the current site, and do a replacement with |
I think it's good to bring up the Media Library, I do think it's related. Patterns are an integral part of a theme and the patterns that are created in the Site Editor reference assets in the Media Library. Whatever fate befalls the fonts will also befall this media: Either it will be exported with a theme or it won't. You're right in that the assets are managed in the same way. Ultimately, CBT will be complete when Core/Gutenberg does all the things and CBT can be sunset. Part of that goal is that when a theme is exported the relevant media elements are exported too. If we do it in CBT it is bound for Core anyway. Doing it now will help inform how other relevant media assets are exported and this seems a simple thing to implement and a good time to do it. However if it's better to defer this and experiment to get it right then I hope we can still target the same timeline, wherever the code changes happen. Regarding fonts from remote hosts, I think that in all instances the result should be the same. A font stored in the theme.zip file and referenced locally. However it's stored in the instance. |
👍 |
WordPress has been lacking in export features for a long time, and this issue with fonts seems to fall right in line with that problem. At the end of the day, if I export a theme, I want everything that's a part of that theme in the export, including media that's part of patterns and any fonts I use in the templates and styles. For me, the question is simply how to implement better export functionality. I think experimenting with font export in Gutenberg's theme zip would be a useful starting point to lead the way. |
I understand why adding this functionality to Create Block Theme may currently feel like the better approach, considering the limited export features currently in WordPress. I'm mainly echoing what's been said above, but I think the new Font Library is a good opportunity to expand the current export features and explore what the next iteration of this functionality looks like in Core. |
I think we would need to implement this on the core at some point. Otherwise, the theme exported by the 'Export' core functionality would be incomplete, right? We could handle the fonts this way:
As a more general comment, all the Export functionality is lacking behind the capabilities implemented on the Create Block Theme plugin; at some point, we should try to move the newer functionality around exporting a theme and testing well in CBT to core. |
I un-assigned myself, since I will not finish this before my extended leave. The above PR is a good place to start I think. |
What?
The text was updated successfully, but these errors were encountered: