-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
"(process:15840): Pango-WARNING **: 20:41:16.548: couldn't load font "sans serif Not-Rotated 10px", falling back to "Sans Not-Rotated 10px", expect ugly output." #1643
Comments
The bit about not having any font instructions is surprising. That error gets triggered when Pango creates a cascade list for a section of text, which happens when you're rendering text, which happens due to |
Ah yes, forgot that information: this is indeed Win10 pro x64 (with node 14.7), without even setting an explicit font. Could it be that Pango is using the wrong naming format under water? (since "sans serif" is not a font, it's an entire category; not being able to find a single font in that category is basically impossible on any OS =) |
Could be, here's where Pango defines those categories: I don't know if |
This yields no errors: import CanvasBuilder from 'canvas';
const canvas = CanvasBuilder.createCanvas(100,100);
const ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(100,0);
ctx.lineTo(100,100);
ctx.strokeStyle=`red`;
ctx.fillStyle=`green`;
ctx.stroke(); This does: import CanvasBuilder from 'canvas';
const canvas = CanvasBuilder.createCanvas(100,100);
const ctx = canvas.getContext('2d');
ctx.fillText("and some text", 50, 50); citing: >node test.js
(process:14640): Pango-WARNING **: 10:09:32.235: couldn't load font "sans serif Not-Rotated 10px", falling back to "Sans Not-Rotated 10px", expect ugly output. So I suspect pango doesn't even get initialised until the first time it's actually needed, evidenced by the fact that if I run multiple canvas sketches with text during the same Node run (e.g. multiple files that import |
You probably only see the error once because Pango caches font sets aggressively. I don't know how I'm just now realizing this, but CSS uses
We just have to do the translation from "sans-serif" to "sans" internally. Only problem is I don't know if macOS understands I'll open that PR now |
Nothing like a major semver update because "we fixed something, but it might have broken some people's configs, and we won't know until the bugs come rolling in" =P |
that is not the button I wanted to press >_> |
Windows problem, you must install the font first on your pc or it will give that error |
@KingCodeSquid how about reading the text of, and looking at the PR for, an issue, before commenting on something that's been resolved and closed for half a year, first =) |
Except it's still broken on Windows =) @KCSquid thank you for your comment, it helped me. |
Is there a way to prevent the warning
(process:15840): Pango-WARNING **: 20:41:16.548: couldn't load font "sans serif Not-Rotated 10px", falling back to "Sans Not-Rotated 10px", expect ugly output.
? My code doesn't issue a font instruction anywhere, so seeing it complain about not being able to fulfill "sans serif Not-Rotated 10px" is very odd indeed. I even tried setting an explicitctx.font = "sans not-rotated 10px";
but the warning still shows up.The text was updated successfully, but these errors were encountered: