harfbuzz / rustybuzz

A complete harfbuzz's shaping algorithm port to Rust
MIT License
551 stars 36 forks source link

Example on how to draw with this #25

Open sandmor opened 3 years ago

sandmor commented 3 years ago

So, I never use harfbuzz and I'm a bit lost about how to use this and integrate with ttf-parser or rusttype, can you provide an example of using this to draw non-latin text, I'm talking of an example with tiny-skia, ttf-parser and this or something that you want. Thank you in advance

RazrFalcon commented 3 years ago

Yes, I've planned to write such example. It would be a bit rudimentary, because font fallback and emojis must be handled by the caller, but other than that it should be fine.

xobs commented 3 years ago

I have a terrible, awful repo up at https://git.xobs.io/xobs/rust-font-test that you're welcome to steal from. That repository is an experiment in memory usage and rendering.

It uses rusttype for rendering.

It even renders emoji properly, and does a decent job of Arabic.

sandmor commented 3 years ago

@xobs Thank you