[FEATURE] Expose additional API for variable font support
Is your feature request related to a problem? Please describe.
I'd like to paint text with font variation options but the needed API is not exposed to HarfBuzzSharp nor SkiaSharp.
Describe the solution you'd like
Requested Skia api: https://api.skia.org/structSkFontParameters.html https://api.skia.org/classSkTypeface.html#a01b379aa05f1d89af547e32ce3fabbe1
Requested HarfBuzz api: https://harfbuzz.github.io/harfbuzz-hb-font.html#hb-font-set-variations
We are looking to plumb font-variation-settings through to render variable fonts. To do this we need to be able to set variation values by their tags (wght, slnt, etc) in shaping and painting. I think exposing the above api should cover it, though this is new to me and I may be missing something.
This is becoming a deal-breaker as a time goes on. Our users are attacking us with this feature request, and we can do nothing, sadly.
Please, add variable fonts support to the 3.0, if possible. Thanks in advance!
Harfbuzz api can be called directly via pInvokes.
All we actually need is sk_sp<SkTypeface> SkTypeface::makeClone (const SkFontArguments&) const https://api.skia.org/classSkTypeface.html#a01b379aa05f1d89af547e32ce3fabbe1
@mattleibow I hope it's not that hard to add a single api method and a struct into the api, please help us. SkiaSharp needs support for variable fonts for years.
Adding the needed APIs to HarfBuzzSharp should be trivial. These just needs to be added via generator.
What about implementing SkFontArguments / SkTypeface::makeClone for SkiaSharp 3.x? Needed for https://github.com/lay295/TwitchDownloader/issues/1504
Making a comment to lift up the issue. Variable fonts support is mandatory for almost all apps.