linebender / vello

An experimental GPU compute-centric 2D renderer.
http://linebender.org/vello/
Apache License 2.0
2.13k stars 118 forks source link

Cosmic Text example #306

Open nicoburns opened 1 year ago

nicoburns commented 1 year ago

It would be great to have an example of using cosmic-text with Vello. This would be super-helpful for Blitz to get high quality text layout / rendering running on top Vello Long term hopfully parley will also be an option, but it seems that at it isn't ready yet in that it is lacking both documentation and a crates.io release so for the time being cosmic-text is looking like the best option.

@dfrg I believe you had this working. Would you be willing to publish it as an example?

dfrg commented 1 year ago

I’d love to get this in as an example. There is a minor complication around selecting a unique id for the fonts coming from cosmic-text. This can be resolved in a few different ways— I’ll see what I can do.

The major blocker is having simple infrastructure for spinning up new examples. Right now, we just dump everything into the with_winit crate and I’m not sure if that is the right call here.

axelkar commented 3 months ago

Is it possible to do layout with skrifa or rendering with COSMIC Text?

axelkar commented 3 months ago

Nevermind that - Do I take individual glyphs from COSMIC Text and just shove them down vello::DrawGlyphs?

dfrg commented 3 months ago

Yes, the draw glyphs API is the intended entry point for this and my prior experiment had this working with cosmic-text though I’m sure the code is massively out of date at this point.