Automattic / Automattic/node-canvas

Text style not applied

Open
#1,667 2 comments 1 reaction 0 assignees View on GitHub
Text & Fonts
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

## Issue or Feature
I want to use SanFrancisco. I need Black and regular styles, but for some reason the style is not applied :(

## Steps to Reproduce
```js
registerFont(__dirname + "/fonts/regular.ttf", {family: "SF"});
registerFont(__dirname + "/fonts/black.ttf", {family: "SF", weight: "bold"});

const canvas = createCanvas(512, 512);
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#ffffff';
ctx.fillRect(0, 0, 512, 512);

ctx.fillStyle = '#000000';
ctx.font = '125px SF';
ctx.fillText("First text", 0, 100);

ctx.font = 'bold 85px SF';
ctx.fillText("Second text", 0, 175);
```

## Your Environment
* Version of node-canvas - 2.6.1
* Environment node 12.18.4 on Windows 10

![image](https://user-images.githubusercontent.com/52464939/93712553-49fcf180-fb5f-11ea-9496-8f5ac5e0d75b.png)

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.