mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.4k stars 535 forks source link

OT-SVG support: binding SkGraphics::SetOpenTypeSVGDecoderFactory() #2939

Open HinTak opened 2 months ago

HinTak commented 2 months ago

Is your feature request related to a problem?

The skia-python equivalent is in:

https://github.com/kyamagu/skia-python/blob/e0b030c14e33f70880cfcc502eaeed898a77fc3c/src/skia/main.cpp#L82

Either provide that as a extra /optional call, or put it in SkiaSharp somewhere during load-time, one off, as in skia-python. The line switches on OT-SVG colour font support within skia.

You might need to add a little to your libskiasharp.so process, but ask me if you encounter problems. (I am the one who put that line in skia-python).

And possibly reference this shell script for skia build options:

https://github.com/HinTak/skia-building-fun/blob/main/download-and-build-skia.sh

Describe the solution you would like

Support ot-svg colour fonts

Describe alternatives you have considered

This is an obscure and new part of skia's api (since m103 or thereabouts, I believe), it unlikely you have already bound it yet.

Additional context

No response

Code of Conduct

HinTak commented 2 months ago

Didn't know you are so behind compared to skia-python - you need the svg module for the functionality I mentioned. The svg module became non-experimental in m88. I.e. you might need to deal with https://github.com/mono/SkiaSharp/issues/2689 first.