samizdatco / skia-canvas

A GPU-accelerated 2D graphics environment for Node.js
MIT License
1.67k stars 63 forks source link

Specify fonts via generic family names #114

Open PikaDude opened 1 year ago

PikaDude commented 1 year ago

In CSS (and HTML5 canvas) you can specify fonts via a generic name, such as serif, sans-serif, monospace, etc. (more info here: https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#syntax)

Although in skia-canvas, this does not seem to be possible unfortunately and it makes it quite hard to fall back to a font of a specific style to fit the context of the image. Would this be able to be implemented?