Skip to content

Pango-CRITICAL errors when using Canvas on Windows #2492

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

Open
JanitorialMess opened this issue Feb 25, 2025 · 1 comment
Open

Pango-CRITICAL errors when using Canvas on Windows #2492

JanitorialMess opened this issue Feb 25, 2025 · 1 comment

Comments

@JanitorialMess
Copy link

When using node-canvas on Windows, I consistently encounter Pango-CRITICAL errors referencing pango_font_description_get_family: assertion 'desc != NULL' failed. These errors appear immediately upon calling canvas.getContext('2d'), even in minimal code examples that don't explicitly work with text or fonts. While my code continues to function despite these errors, they flood the console output.

I've tried :

  • Following the manual windows installation instructions guide
  • Manually registering fonts
  • Using system fonts and custom fonts (I have no use for fonts whatsoever but thought it might help make the error disappear)

Nothing worked so far.

Reproduction Steps

This minimal example reproduces the issue:

import { Image, createCanvas } from 'canvas';
import * as fs from 'fs';

const imagePath = './src/images/test.jpg';
const image = new Image();
image.src = fs.readFileSync(imagePath);
const canvas = createCanvas(image.width, image.height);
// The following line triggers Pango-CRITICAL errors:
const ctx = canvas.getContext('2d');

Error Output

(process:47272): Pango-CRITICAL **: 17:39:18.415: pango_font_description_get_family: assertion 'desc != NULL' failed
(process:47272): Pango-CRITICAL **: 17:39:18.416: pango_font_description_get_family: assertion 'desc != NULL' failed
(process:47272): Pango-CRITICAL **: 17:39:18.416: pango_font_description_get_family: assertion 'desc != NULL' failed
(process:47272): Pango-CRITICAL **: 17:39:18.416: pango_font_description_get_family: assertion 'desc != NULL' failed
(process:47272): Pango-CRITICAL **: 17:39:18.416: pango_font_description_get_family: assertion 'desc != NULL' failed
(process:47272): Pango-CRITICAL **: 17:39:18.416: pango_font_description_get_family: assertion 'desc != NULL' failed
(process:47272): Pango-CRITICAL **: 17:39:18.416: pango_font_description_get_family: assertion 'desc != NULL' failed
(process:47272): Pango-CRITICAL **: 17:39:18.416: pango_font_description_get_family: assertion 'desc != NULL' failed

Environment

  • Canvas: v3.1.0
  • Node.js: v23.0.0
  • OS: Windows 24H2 (OS Build 26100.3194)
@fuchsundvogel
Copy link

Bump. Same problem 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