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

Not able to load the Uni-Sans Font Family using Canvas #2469

Open
Naved143 opened this issue Dec 16, 2024 · 0 comments
Open

Not able to load the Uni-Sans Font Family using Canvas #2469

Naved143 opened this issue Dec 16, 2024 · 0 comments

Comments

@Naved143
Copy link

Hello I am trying to load the Uni Sans Heavy Font using the node canvas but I am getting this warning again and again and hence not loading the font.

(process:20792): Pango-WARNING **: 19:43:22.791: couldn't load font "Uni Sans Heavy Not-Rotated 60px", falling back to "Sans Heavy Not-Rotated 60px", expect ugly output.

(process:20792): Pango-WARNING **: 19:43:22.827: couldn't load font "Uni Sans Heavy Not-Rotated 40px", falling back to "Sans Heavy Not-Rotated 40px", expect ugly output.

(process:20792): Pango-WARNING **: 19:43:22.840: couldn't load font "Uni Sans Heavy Not-Rotated 30px", falling back to "Sans Heavy Not-Rotated 30px", expect ugly output.

This is the code I am using

registerFont(
  path.join(__dirname, "..", "..", "assets", "fonts", "Uni Sans Heavy.ttf"),
  { family: "Uni Sans Heavy" }
);

ctx.font = "bold 60px 'Uni Sans Heavy'";

How can I fix this issue? Please help me! Thanks

Canvas version: 2.10.2
Node.js version: 18
OS: Windows 11

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

No branches or pull requests

2 participants