We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Steps:
Expected: Font is the same as whatever you set it to
Actual: Font is reset to the standard system font
I ran into this when using ctx.measureText and setting the canvas to the text size.
ctx.measureText
Feel free to close if this is working as expected.
const fontPath = path.join(__dirname, './fonts/MyFont.ttf') const isRegistered = GlobalFonts.registerFromPath(fontPath, 'MyFont') if (!isRegistered) { throw new Error('Failed to register font') } const canvas = createCanvas(300, 150) const ctx = canvas.getContext('2d') ctx.font = '25px Caveat' canvas.width = 250 ctx.fillStyle = 'black' ctx.fillText('some text', 0, 50) const url = canvas.toDataURL('image/png') console.log(url)
The text was updated successfully, but these errors were encountered:
I can confirm it too.
Sorry, something went wrong.
No branches or pull requests
Steps:
Expected:
Font is the same as whatever you set it to
Actual:
Font is reset to the standard system font
I ran into this when using
ctx.measureText
and setting the canvas to the text size.Feel free to close if this is working as expected.
The text was updated successfully, but these errors were encountered: