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

Font collection schema requiring 'slug' and 'name' #60259

Closed
justintadlock opened this issue Mar 27, 2024 · 0 comments · Fixed by #60285
Closed

Font collection schema requiring 'slug' and 'name' #60259

justintadlock opened this issue Mar 27, 2024 · 0 comments · Fixed by #60285
Assignees
Labels
[Feature] Font Library [Type] Bug An existing feature does not function as intended

Comments

@justintadlock
Copy link
Contributor

Description

The font collection schema seems to have requirements for some fields that are no longer required. I believe both the slug and name fields are no longer required:

"required": [ "$schema", "slug", "name", "font_families" ]

I believe these may have been missed when this was changed here: #59314

Step-by-step reproduction instructions

Register a collection via JSON with the $schema key:

{
	"$schema": "https://schemas.wp.org/trunk/font-collection.json",
	"font_families": [
		{
			"font_family_settings": {
				"name": "Henny Penny",
				"fontFamily": "Henny Penny, system-ui",
				"slug": "henny-penny",
				"fontFace": [
					{
						"src": "https://fonts.gstatic.com/s/hennypenny/v17/wXKvE3UZookzsxz_kjGSfMQvt3M7tMDT.woff2",
						"fontWeight": "400",
						"fontStyle": "normal",
						"fontFamily": "Henny Penny",
						"preview": "https://s.w.org/images/fonts/17.7/previews/henny-penny/henny-penny-400-normal.svg"
					}
				],
				"preview": "https://s.w.org/images/fonts/17.7/previews/henny-penny/henny-penny.svg"
			},
			"categories": [ "display" ]
		},
		{
			"font_family_settings": {
				"name": "MedievalSharp",
				"fontFamily": "MedievalSharp, system-ui",
				"slug": "medievalsharp",
				"fontFace": [
					{
						"src": "https://fonts.gstatic.com/s/medievalsharp/v26/EvOJzAlL3oU5AQl2mP5KdgptAqp6MwvXLDk.woff2",
						"fontWeight": "400",
						"fontStyle": "normal",
						"fontFamily": "MedievalSharp",
						"preview": "https://s.w.org/images/fonts/17.7/previews/medievalsharp/medievalsharp-400-normal.svg"
					}
				],
				"preview": "https://s.w.org/images/fonts/17.7/previews/medievalsharp/medievalsharp.svg"
			},
			"categories": [ "display" ]
		},
		{
			"font_family_settings": {
				"name": "Metamorphous",
				"fontFamily": "Metamorphous, system-ui",
				"slug": "metamorphous",
				"fontFace": [
					{
						"src": "https://fonts.gstatic.com/s/metamorphous/v20/Wnz8HA03aAXcC39ZEX5y1330OSCthTsmaQ.woff2",
						"fontWeight": "400",
						"fontStyle": "normal",
						"fontFamily": "Metamorphous",
						"preview": "https://s.w.org/images/fonts/17.7/previews/metamorphous/metamorphous-400-normal.svg"
					}
				],
				"preview": "https://s.w.org/images/fonts/17.7/previews/metamorphous/metamorphous.svg"
			},
			"categories": [ "display" ]
		}
	]
}

Check code editor like VS Code and see notice:

font-collection-schema

Screenshots, screen recording, code snippet

No response

Environment info

  • Schema issue - shown in VS Code.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@justintadlock justintadlock added [Type] Bug An existing feature does not function as intended [Feature] Font Library labels Mar 27, 2024
@t-hamano t-hamano self-assigned this Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Font Library [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants