Skip to content
New issue

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

[FEATURE] Expose additional API for variable font support #2397

Open
cr4yz opened this issue Feb 23, 2023 · 3 comments
Open

[FEATURE] Expose additional API for variable font support #2397

cr4yz opened this issue Feb 23, 2023 · 3 comments

Comments

@cr4yz
Copy link

cr4yz commented Feb 23, 2023

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.

@Mikolaytis
Copy link
Contributor

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!

@Mikolaytis
Copy link
Contributor

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.

@Gillibald
Copy link
Contributor

Adding the needed APIs to HarfBuzzSharp should be trivial. These just needs to be added via generator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants