Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas cannot register font with em size 12 #2434

Open
1 task done
jejebecarte opened this issue Sep 28, 2024 · 0 comments
Open
1 task done

Canvas cannot register font with em size 12 #2434

jejebecarte opened this issue Sep 28, 2024 · 0 comments

Comments

@jejebecarte
Copy link

Issue or Feature

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 are that the outlines have been scaled to twice their original size.

Steps to Reproduce

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant