Allowing to push multiple font styles to the same paragraph in Skia

Could we expose the ability to push multiple font styles to the same Paragraph in Skia?

Here’s docs for React Native Skia:

You can see one can push different style for successive text within the same Paragraph.

Can Text (Sequence) node be changed such that it takes in a sequence of Paint as well?

See: VL.RichtextKit

Is Richtext is a completely different thing, and not based on top of Skia’s own font APIs?

If so, I think I should change this post to a feature request and ask devvvvs if they could expose the APIs I shown in the screenshot.

Your screenshot refers to a project in the React Native universe. If you can point to APIs which are actually part of Skia itself and also exposed by SkiaSharp we can definitely have a look.

I couldn’t find it in SkiaSharp, but here it is in Skia: ParagraphBuilderImpl.h and ParagraphBuilderImpl.cpp. Searching for it in https://api.skia.org didn’t yield any result, so I’m not sure if SkiaSharp didn’t include it because it was not part of core API.

That being said, it is available in other bindings, like in Kotlin’s binding and in Python’s binding.

Interesting - would be nice to know what is what here. Why native Skia has a SkParagraph module, and SkiaSharp not mentioning it at all but instead referring to HarfBuzz. Good read in that regard The Trouble with Text Rendering in SkiaSharp and HarfBuzz - Michaels Blog

Seems like bjoern you were right all along about using RichTextKit 😄. I’ll close this for now as there’s no plan from SkiaSharp to support SKParagraph.

Thanks guys for the help!


For future readers, if you want to know more about Extended Grapheme Clusters and font rendering, I can recommend: