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 Library doesn't support Font Faces that have multiple assets. #58173

Closed
pbking opened this issue Jan 24, 2024 · 0 comments · Fixed by #58216
Closed

Font Library doesn't support Font Faces that have multiple assets. #58173

pbking opened this issue Jan 24, 2024 · 0 comments · Fixed by #58216
Assignees
Labels
[Feature] Font Library [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Experimental Experimental feature or API.

Comments

@pbking
Copy link
Contributor

pbking commented Jan 24, 2024

Description

If a user installs a font face from a Font collection that references an ARRAY of sources the front-end throws an error and doesn't add the font face.

If the font face src is a STRING then the installation works as expected.
If the font face src is an ARRAY of strings (which is valid) the front-end will throw an error.

Step-by-step reproduction instructions

Add a Font Collection that has a font face that references multiple font faces like so:

wp_register_font_collection( array(
	'slug'        => 'test-collection',
	'name'        => 'Test Collection',
	'description' => 'A Font Collection to use to break stuff.',
	'font_families'        => array( [
    		'font_family_settings' => array(
    			'name'       => 'Test Font Family',
    			'fontFamily' => 'Test Font Family',
    			'slug'       => 'test-font-family',
    			'fontFace'   => array( array(
          			'src'        => [
					'https://fonts.gstatic.com/s/texturina/v28/c4mM1nxpEtL3pXiAulRTkY-HGmNEX1b9NspjMwhAgliHhVrXy2eYGvUg25riW1OD.ttf',
                			'https://fonts.gstatic.com/s/chivo/v18/va9b4kzIxd1KFppkaRKvDRPJVDf_vB_ul2DSFXjQiQ.ttf',
				],
            			'fontWeight' => '400',
            			'fontStyle'  => 'normal',
            			'fontFamily' => 'Test Font Family',
        		) ),
		),
	], ),
) );

Screenshots, screen recording, code snippet

No response

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

@pbking pbking added [Type] Bug An existing feature does not function as intended [Type] Experimental Experimental feature or API. [Feature] Font Library labels Jan 24, 2024
@annezazu annezazu moved this to 🏗️ In Progress in WordPress 6.5 Editor Tasks Jan 24, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jan 24, 2024
@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to ✅ Done in WordPress 6.5 Editor Tasks Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Font Library [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Experimental Experimental feature or API.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant