Automattic / Automattic/node-canvas
Canvas cannot register font with em size `12`
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
## Issue or Feature
- [x] If this is an issue with installation, I have read the [troubleshooting guide](https://github.com/Automattic/node-canvas/issues/1511).
Canvas throws `Error: Could not parse font file` for a font with em size `12`, but works on the same font with em size `24`.
The only difference between [these two fonts](https://github.com/user-attachments/files/17171807/fonts.zip) are that the outlines have been scaled to twice their original size.
## Steps to Reproduce
```js
import path from 'path';
import { registerFont } from 'canvas';
const fontFile = (fileName: string) => path.join(__dirname, 'fonts/', fileName);
registerFont(fontFile('24-em-font.otf'), { family: 'Minecraft' });
registerFont(fontFile('12-em-font.otf'), { family: 'Minecraft' });
```
## Your Environment
* Version of node-canvas: `2.10.2`
* Environment: node `v18.20.4` on `Windows 10 (22H2)`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.