Closed ten3roberts closed 3 months ago
Is it possible to get the bounds (width + height) of a Buffer after shaping?
Buffer
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.
layout_runs()
My use case is to layout text and get its size in order to give it a background rectangle.
Thanks
It's not particularly nice, but it's possible. See the code linked in https://github.com/pop-os/cosmic-text/issues/70#issuecomment-1712645954
This will be handled in #70.
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