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

Support woff2 #359

Open
eric-gitta-moore opened this issue Oct 23, 2024 · 2 comments
Open

Support woff2 #359

eric-gitta-moore opened this issue Oct 23, 2024 · 2 comments

Comments

@eric-gitta-moore
Copy link

eric-gitta-moore commented Oct 23, 2024

First of all, this project is great in my program. But I ran into some problems, as shown in the link below, and I'm not sure why woff2 can be loaded, but it won't load in my node program. And got an error.

https://github.com/yisibl/resvg-js?tab=readme-ov-file#browser

log:

[2024-10-23T06:38:42Z WARN  fontdb] Failed to load a font face 0 from '/Users/admin/workspace/assets/fonts/EuclidCircularA/EuclidCircularA-Bold.woff2' cause malformed font.

I looked at the loading process in detail.

it likes: resvg-js -> resvg -> fontdb -> ttf-parser

Then I see that ttf-paser mentions that only TrueType, OpenType, and AAT are supported.

As you can see in the code: https://github.com/RazrFalcon/ttf-parser/blob/bee14b10c19551bd3cc13257ebcaa41188f2e60d/src/lib.rs#L138

Then I saw an issue in the ttf-parser repository.

Obviously, the underlying dependencies don't support woff2 now

@yisibl
Copy link
Member

yisibl commented Oct 23, 2024

We use woff2-rs to parse woff2 fonts. Please check if your font can be parsed properly in woff2-rs first.

https://github.com/yisibl/resvg-js/blob/39eaa225b3d9b9274d4e27fe4f01922bd601c06a/Cargo.toml#L61

@yisibl
Copy link
Member

yisibl commented Nov 1, 2024

Please upload your fonts here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants