Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting bounding box of text after layout #205

Open
ten3roberts opened this issue Dec 11, 2023 · 1 comment
Open

Getting bounding box of text after layout #205

ten3roberts opened this issue Dec 11, 2023 · 1 comment

Comments

@ten3roberts
Copy link

Is it possible to get the bounds (width + height) of a Buffer after shaping?

The layout_runs() api does not give the line's total width, neither is it possible to extract it from the glyphs without using the swash cache.

My use case is to layout text and get its size in order to give it a background rectangle.

Thanks

@nicoburns
Copy link
Contributor

It's not particularly nice, but it's possible. See the code linked in #70 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants