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

Guidance for implementing a SkiaSharp renderer #804

Open
kpko opened this issue Jun 29, 2024 · 2 comments
Open

Guidance for implementing a SkiaSharp renderer #804

kpko opened this issue Jun 29, 2024 · 2 comments
Labels

Comments

@kpko
Copy link

kpko commented Jun 29, 2024

Hi!

I'm interested in implementing a custom renderer for Markdig to render to SkiaSharp. SkiaSharp provides a "Canvas" element with methods like DrawLine, DrawImage, DrawText etc. That would make it possible to render to PNGs, PDFs...

Could somebody give me a starting point? I got a bit confused by the Normalize-Render classes, ObjectRenderers.. What would be the easiest point to start an implementation? Also, what would be the best thing to make the implementation as complete as possible (i.e. no missing renderers for components)?

Thank you very much!

@kpko kpko changed the title SkiaSharp renderer Guidance for implementing a SkiaSharp renderer Jun 29, 2024
@xoofx xoofx added the question label Jul 13, 2024
@xoofx
Copy link
Owner

xoofx commented Jul 13, 2024

You can try to get some inspiration from https://github.com/Kryptos-FR/markdig.wpf/tree/main/src/Markdig.Wpf/Renderers/Wpf which translates a Markdown document to WPF elements.

@jefflomax
Copy link

I'm interested in this idea also - I have a very primitive one and found this thinking I could use markdig to handle the markdown far better than I have. It I get it good enough I'll open source it.
I found these https://swharden.com/csdv/skiasharp/drawtext-rectangle/ instructions helpful getting lots of the SkiaSharp backend working.

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

No branches or pull requests

3 participants