Automattic / Automattic/node-canvas

Assertion failed: (!scaled_font->cache_frozen), function _cairo_scaled_glyph_page_destroy, file cairo-scaled-font.c, line 459. Abort trap: 6

Open
#912 15 comments 8 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

## Issue

I seem to be hitting a bug when using ctx.fillText. In the code sample below, I can do ctx.fillRect fine and do get a rectangle output with the correct color and dimensions, but the text string errs. If I comment out the `ctx.fillText("Hello World", 100, 100);` line, the canvas builds the image as expected. Obviously, I'd like to stick some text on top of the canvas before the image file is generated, but .fillText gives the following error:

Assertion failed: (!scaled_font->cache_frozen), function _cairo_scaled_glyph_page_destroy, file cairo-scaled-font.c, line 459. Abort trap: 6

## Steps to Reproduce

```js
// Paint bg
ctx.fillStyle = bgcolor;
ctx.fillRect(0, 0, width, height);

// Paint text
ctx.font = '30px Arial';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillStyle = color;
// If I comment this fillText line, no error appears in console
ctx.fillText("Hello World", 100, 100);
```

## Your Environment
* Version of node-canvas: 1.6.5
* Environment: node v7.8.0 on Mac OSX Sierra 10.12.4

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.