WordPress / gutenberg

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

Font Manager gives false duplicate font warnings. #59353

Open peterwilsoncc opened 8 months ago

peterwilsoncc commented 8 months ago

Description

When uploading Noto Serif via the Font Managers uploads tab, I'm seeing false warning of duplicate fonts that are blocking uploads of some files.

I am unable to upload NotoSerif-Thin and NotoSerif-ThinItalic as a result.

The error I am seeing is:

Some font faces were installed. There were some errors. Fetch error: A font face matching those settings already exists. Fetch error: A font face matching those settings already exists.

I'm not really clear on what the error is referring too.

Step-by-step reproduction instructions

  1. Download Noto Serif from Google Fonts (don't use the built in importer)
  2. Select all the files with the NotoSerif- prefix
  3. Go to Site Editor > Styles > Typography > Font Manager > Upload
  4. Drag the files to the upload target area
  5. The error

Screenshots, screen recording, code snippet

Gif of upload process.

Note that I drag in 18 files but only 16 are imported.

upload-error

Environment info

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

annezazu commented 8 months ago

Adding to 6.5 but noting that this was was tested with GB trunk rather than with 6.5 beta 2.

pbking commented 8 months ago

The reason for the error is because two of the font faces being uploaded (ExtraLight and Thin I believe) have the same weight value (250). Type/weight is how the client keeps typefaces unique. I'm not sure what else is different to make those to font faces unique but when the second of that pair is sent it isn't considered unique.

ntsekouras commented 8 months ago

It seems there is also some race conditions when uploading fonts with same type/weight. This could result in the same name in the list and not sure how it affects everything else..

The real question for me here is how a font can be different with same type and weight? Is it an alias or there could be more differences? If there are more differences, should they be taken into account on how we construct a unique id?

youknowriad commented 7 months ago

Given that RC1 is today I'm removing this one from 6.5.

colorful-tones commented 5 months ago

Hi folks, We are only one week away from the Beta 1 cut-off date for WordPress 6.6. This issue hasn’t seen any movement in a while, so we (the editor triage leads of the 6.6 release) have decided to remove it from the WordPress 6.6 Editor Tasks project board.