You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 24, 2025. It is now read-only.
Currently word-wrapping can be achieved by first splitting a text into multiple "rectangles of words" via Layout::text:
letmut layout = Layout{meta:LayoutMeta::default(),children:&mut"Layzer is a zero-heap-allocation layout library for building nested layouts with discrete positioning, and sizing. It's designed for terminal UIs, text-based interfaces, and any scenario where you need to compute positions and sizes of rectangular elements.".split_word_bounds().map(Layout::text).collect::<Vec<_>>(),};
layout.compute([20,20]);
layout.iter()...
An idea is to instead compute the size and position (perform text wrapping) only when looking at
the text.
letmut layout = Layout{meta:LayoutMeta::default().data("Layzer is a zero-heap-allocation layout library for building nested layouts with discrete positioning, and sizing. It's designed for terminal UIs, text-based interfaces, and any scenario where you need to compute positions and sizes of rectangular elements."),children:&mut[],};
layout.compute([20,20]);// Need to materialize the text wrapping, in order to measure the size/position
layout.iter()// And again here
compute and iter should probably be merged into a single function...
Currently word-wrapping can be achieved by first splitting a text into multiple "rectangles of words" via
Layout::text:An idea is to instead compute the size and position (perform text wrapping) only when looking at
the text.
computeanditershould probably be merged into a single function...Will likely want to support