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

Upload Fonts: Invalid parameter(s): font_family_settings #62701

Open
at-benni opened this issue Jun 20, 2024 · 3 comments
Open

Upload Fonts: Invalid parameter(s): font_family_settings #62701

at-benni opened this issue Jun 20, 2024 · 3 comments
Labels
[Feature] Font Library [Type] Bug An existing feature does not function as intended

Comments

@at-benni
Copy link
Contributor

Description

As I try to upload fonts in woff2 format, I get the error message.
Invalid parameter(s): font_family_settings

I found out the reason why this is happening is because the font name is missing in the metadata of the font. https://fontdrop.info/

As per w3.org specification the name in the metadata is optional, so this is a valid bug of Gutenberg:
WOFF2:

The WOFF2 file MAY contain a block of extended metadata. The interpretation of this block is exactly the same as [WOFF 1].
https://www.w3.org/TR/WOFF2/#Metadata
WOFF1:

Zero or more name elements may be used to provide a human-friendly name for the collection of extended metadata items in an extension element. A user agent that displays metadata SHOULD choose the name with most the appropriate language from among those available for each named extension element. This child element is OPTIONAL in extension elements; anonymous extension elements are also permissible.
https://www.w3.org/TR/2012/REC-WOFF-20121213/#Metadata

Step-by-step reproduction instructions

  1. Upload a font without the font family meta data

Screenshots, screen recording, code snippet

Screenshots and bug reports at: https://core.trac.wordpress.org/ticket/61426

Environment info

No response

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

@at-benni at-benni added the [Type] Bug An existing feature does not function as intended label Jun 20, 2024
@creativecoder
Copy link
Contributor

We need some kind of unique identifier for the font family before it can be created. So the best way forward seems like finding one or more fallbacks from the font metadata to use for the font family slug when the name isn't present, and then submitting that as the slug in the API request to create the font family.

@creativecoder
Copy link
Contributor

Additionally we need better error handling! The UI should display the error that comes back from the API request, not persist the loading indicator.

@at-benni
Copy link
Contributor Author

Maybe the first upload of the font should fail if there is no unique identifier and return a new submission form, this time with a "name" field.

The loading indicator is stuck when a font with no name is uploaded.
The originally reported error is returned when the font name metadata contains invalid characters.

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
3 participants