Automattic / Automattic/node-canvas
lineWidth not working for strokeText on glyph mode
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
The lineWidth not working for strokeText on glyph mode.
Look at this code:
```js
const { createCanvas } = require('canvas')
const fs = require('fs')
const canvas = createCanvas(200, 400, 'pdf')
const ctx = canvas.getContext('2d')
ctx.textDrawingMode = 'glyph';
ctx.font = '30pt Helvetica'
ctx.fillText('A', 50, 50)
ctx.lineWidth = 20
ctx.strokeStyle = 'red';
ctx.strokeText('A', 50, 100)
const PDFStream = canvas.createPDFStream()
const outputFile = fs.createWriteStream('./output.pdf')
PDFStream.pipe(outputFile);
PDFStream.on('finish', () => {
console.log('PDF file generated successfully!');
});
PDFStream.on('error', (err) => {
console.error('Error generating PDF:', err);
});
```
Output:

But path mode is work:
```diff
- ctx.textDrawingMode = 'glyph';
```

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.