fserb / canvas2D

Update Canvas 2D API
Other
151 stars 25 forks source link

Text Modifiers — Variable Fonts #16

Open Martin-Pitt opened 3 years ago

Martin-Pitt commented 3 years ago

I think it would be important to port over CSS support of variable fonts, as they are an important new feature gaining a lot of traction right now.

For example:

font-variation-settings: 'wght' 700;

So should support the font-variation-settings property as attribute DOMString fontVariationSettings.

At the moment, the current workaround is to apply it crudely on the canvas element to affect all text drawn, e.g. https://codepen.io/JuanFuentes/details/bGpGpzg