`context.font` doesn't update on alpine
Opened this issue · 3 comments
2fd commented
I'm trying to create an image inside a node container on alpine, but the prop front
doesn't update if I assign a new value.
As a Proof of Concept I setup this repo https://github.com/2fd/poc-skia-canvas-context to show the error.
It runs the following test:
// Create canvas and context
const canvas = new Canvas(100, 100)
const context = canvas.getContext('2d')
// Check default value
expect(context.font).toBe('10px sans-serif')
// Check update
context.font = 'normal 600 20px/24px Times'
expect(context.font).toBe('normal 600 20px/24px Times')
and run it on node 14
, 16
, 18
, and 20
using slim
and alpine
and it fails on every version of alpine
the value of font never was updated
arthurbdev commented
Did you find a workaround?
2fd commented
no, I didn't
2fd commented
Hi @arthurbdev, after digging a little bit a found the root cause here. If you try to update the context with a font that is not present on your distro it will ignore any other change. In which case the solution will be to install the font you will use.