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

Theme: Failed to decode font #6861

Closed
KOliver94 opened this issue Jul 10, 2024 · 15 comments · Fixed by #6977 or leoo1992/GeradorQRCode#85 · May be fixed by mtech-31-quemistry/quemistry_client_web#20
Closed

Theme: Failed to decode font #6861

KOliver94 opened this issue Jul 10, 2024 · 15 comments · Fixed by #6977 or leoo1992/GeradorQRCode#85 · May be fixed by mtech-31-quemistry/quemistry_client_web#20
Assignees
Labels
Component: Theme Issue or pull request is related to Theme Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@KOliver94
Copy link
Contributor

Describe the bug

The fonts are not loaded properly with the new 10.7.0 version and I see the following warnings in the console. The browser uses a fallback font as Inter could not be loaded.

Failed to decode downloaded font: http://localhost:5174/node_modules/primereact/resources/themes/lara-light-blue/fonts/Inter-roman.var.woff2?v=3.19
OTS parsing error: Failed to convert WOFF 2.0 font to SFNT

Failed to decode downloaded font: http://localhost:5174/node_modules/primereact/resources/themes/lara-light-blue/fonts/Inter-italic.var.woff2?v=3.19
OTS parsing error: Size of decompressed WOFF 2.0 is less than compressed size

image
image

Reproducer

No response

PrimeReact version

10.7.0

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 126.0.6478.127

Steps to reproduce the behavior

  1. Open any StackBlitz project and use PrimeReact version 10.7.0.
  2. Check the console for warnings
  3. Verify the fonts are not loaded properly and a fallback font is used (Chrome uses Arial as fallback)

Expected behavior

Fonts loaded properly as in earlier versions.

@KOliver94 KOliver94 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 10, 2024
@melloware melloware added Component: Theme Issue or pull request is related to Theme and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jul 10, 2024
@melloware
Copy link
Member

@onursenture can you help here this looks like something is invalid with the theme or font.

The error "Failed to convert WOFF 2.0 font to SFNT" typically occurs when there is an issue converting a Web Open Font Format version 2.0 (WOFF 2.0) font file to a standard TrueType or OpenType font (SFNT). SFNT stands for "Spline Font" and is a font file format used for TrueType and OpenType fonts.

This error can occur for several reasons:

Corrupt Font File: The WOFF 2.0 file might be corrupted or improperly formatted.
Unsupported Features: The conversion tool or software might not support certain features or structures present in the WOFF 2.0 file.
Compatibility Issues: There might be compatibility issues between the font file and the tool or software attempting the conversion.
Software Bugs: There could be bugs or limitations in the software performing the conversion.

@YellowLime77
Copy link
Contributor

I'm having the same problem with the default Lara themes, so I switched to Viva. Unfortunately, there are new yet similar errors:

image

@lekhnath
Copy link

Same here. Screenshot attached.

image

@zeltrex7
Copy link

I got the same error with primereact version 10.7.0 . i just downgraded the version to 10.5.0 now it seems to be showing no error and working fine. seems like in version 10.7.0 the fonts are corrupted since i cannot preview them in extension or browser which is not the case in 10.5.0. .

@nitrogenous nitrogenous added the Type: Bug Issue contains a defect related to a specific component. label Jul 23, 2024
@KOliver94
Copy link
Contributor Author

Hey guys,

It's still in issue in version 10.8.0. I think it's a pretty big problem as none of the default themes work properly. Can you please try to fix it?

Reproducation environment with the newly released version: https://stackblitz.com/edit/kcrywb?file=package.json

@melloware
Copy link
Member

@onursenture ping...

@onursenture
Copy link
Member

@onursenture ping...

I've updated the Inter font: 91d18f0

Could you verify if the issue is fixed?

@melloware melloware added this to the 10.8.1 milestone Aug 2, 2024
@KOliver94
Copy link
Contributor Author

Hey @onursenture,

I've built primereact locally and installed it to my project. You can see it tries to load the new fonts but still fails.

image

@KOliver94
Copy link
Contributor Author

KOliver94 commented Aug 3, 2024

As I was already there I narrowed down the cause of the issue to this commit d3da717. The new gulp major version introduced a change with encoding which breaks fonts by default. See related issues: gulpjs/gulp#2797, gulpjs/gulp#2790

I opened a PR with the fix: #6977

@melloware
Copy link
Member

10.8.1 is now in NPM if you guys want to try again.

@melloware
Copy link
Member

I just tried and something is not right.

@KOliver94
Copy link
Contributor Author

KOliver94 commented Aug 5, 2024

The change in themes got reverted while the actual files not. deac8c9

Update:
So this commit 91d18f0 renamed the font files as well and updated the theme. The later commit updated the theme but the files are still named something else.

https://github.com/primefaces/primereact/tree/master/public/themes/lara-light-blue/fonts

@melloware
Copy link
Member

Yep I let them know....

@melloware melloware modified the milestones: 10.8.1, 10.8.2 Aug 6, 2024
@melloware
Copy link
Member

OK 10.8.2 is out can everyone try again!

@lekhnath
Copy link

lekhnath commented Aug 9, 2024

@melloware I tested with version 10.8.2 and the font issue appears to be resolved. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Theme Issue or pull request is related to Theme Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
7 participants