Skip to content

[BUG] Emoji rendering breaks subsequent canvas drawing on ARM Linux (no error) #2567

@948764321

Description

@948764321

Environment:

  • node-canvas version: 3.1.0
  • Node.js version: 20.9.0
  • Platform: ARM Linux
  • Font: Segoe UI Emoji

Describe the bug:
When attempting to render an emoji character (⚠️) using the "Segoe UI Emoji" font on ARM Linux, the emoji fails to render correctly, and all subsequent drawing operations are lost — the canvas effectively becomes blank after calling fillText() for that emoji. No error is thrown, and the process continues without any crash or warning.

Steps to reproduce:

const { createCanvas } = require('canvas');

const canvas = createCanvas(400, 200);
const ctx = canvas.getContext('2d');

// This works fine
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, 400, 200);
ctx.fillStyle = 'white';
ctx.font = '48px "Segoe UI Emoji"';
ctx.fillText('Hello', 50, 50);  // Renders correctly

// This emoji breaks everything
ctx.fillText('⚠️', 50, 100);    // Emoji not rendered, subsequent drawing lost

// The following drawing never appears
ctx.fillStyle = 'blue';
ctx.fillText('After emoji', 50, 150);  // NOT RENDERED

console.log('No error, no crash, but canvas is effectively corrupted after the emoji');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions