yeslogic / allsorts

Font parser, shaping engine, and subsetter implemented in Rust
https://yeslogic.com/blog/allsorts-rust-font-shaping-engine/
Apache License 2.0
706 stars 23 forks source link

How do I measure pixel width of a string of text? #104

Closed Tameflame closed 3 months ago

Tameflame commented 3 months ago

I want to implement text wrapping for my ui library and it requires measuring the dimensions of a string of text so I can compare it to the line width. Is there an example with this library to do so?

It would need to take into consideration emojis and kerning.