Automattic / Automattic/node-canvas

The node.js process gets terminated by node-canvas

Open
#1,118 3 comments 0 reactions 0 assignees View on GitHub
Needs more info
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

## Issue or Feature
The node-canvas crashes the node.js process after a few seconds when (possibly) a custom font doesnt load.

Error:
```
(node.exe:4992): Pango-WARNING **: couldn't load font "Custom Not-Rotated 1
0px", falling back to "Sans Not-Rotated 10px", expect ugly output.

(node.exe:4992): Pango-CRITICAL **: pango_win32_font_map_get_font_cache: asserti
on `font_map != NULL' failed
**
Pango:ERROR:pangowin32.c:831:pango_win32_font_finalize: assertion failed: (win32
font->fontmap != NULL)

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
```
## Steps to Reproduce

```js
const { createCanvas, loadImage, Image, registerFont } = require('canvas');
const canvas = createCanvas(200, 200);
const ctx = canvas.getContext('2d');

registerFont('./assets/fonts/Custom.ttf', {family: 'custom_font_name'});
ctx.font = 'normal 10px custom_font_name'
ctx.fillText("Text", 250, 200)
```

## Your Environment
* Version of node-canvas (e.g. 1.4.0): 2.0.0-alpha.11
* Environment (e.g. node 4.2.0 on Mac OS X 10.8): node v8.10.0 on win7

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.