pub struct LineHeightStyle {
pub alignment: LineHeightAlignment,
pub trim: LineHeightTrim,
pub mode: LineHeightMode,
}Expand description
The line-height policy lives with the drawing-side text types, because a
DrawScope has to be able to name it too:
a run drawn through a canvas and a Text composable on the same screen must
resolve their line boxes by the same rule, and the only style a draw scope
can carry is the flat one from cranpose-ui-graphics.
How a line of text sits inside the height it was given.
A style that names one is laid out by AOSP’s StaticLayout rule — whole-pixel
metrics, a font that a short line height cannot shrink, and the odd pixel of
leading below the baseline. A style that names none keeps the framework’s
plain arithmetic: the box is exactly the requested height with the leading
split evenly. The two disagree by a device pixel on most faces, so a screen
that draws through a crate::DrawScope and composes Text in the same
frame has to state the same policy on both or the two sets of rows will not
line up.
Fields§
§alignment: LineHeightAlignment§trim: LineHeightTrim§mode: LineHeightModeTrait Implementations§
Source§impl Clone for LineHeightStyle
impl Clone for LineHeightStyle
Source§fn clone(&self) -> LineHeightStyle
fn clone(&self) -> LineHeightStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more