Automattic / Automattic/node-canvas
Not able to load the Uni-Sans Font Family using Canvas
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.