Closed BKSalman closed 1 year ago
Hi! :wave: For now you'd generally want to set the buffer bounds to some area you place to place the text in, then use options like alignment to align the text within those bounds.
Currently it might be easiest to measure each line (e.g., in iced
it's done like https://github.com/iced-rs/iced/blob/a3489e4af960388e9f73988b88df361022a654a4/wgpu/src/text.rs#L293-L301). You could also use visible_lines
with the line height as an approximation for the vertical height of visible lines only.
Thank you for the quick reply!
I used the same way iced did that, and it worked :).
thank you for helping!
Hello!
I want to get the size of the rendered text rather than the whole buffer dimensions, because I'm setting it to the whole width of the window (probably shouldn't do that(?)), but if there is a way to measure the text with a function or something that would solve a couple of issues I'm having
can this be done in this crate or
cosmic-text
?