pub struct Layout {
pub origin: [f64; 2],
pub m: [f64; 4],
pub px: bool,
pub glyphs: Vec<Placed>,
pub lines: Vec<Line>,
pub bars: Vec<Bar>,
pub ink: Option<[f64; 4]>,
pub cell: [f64; 4],
pub em: f64,
pub x_height: f64,
}Expand description
a text laid out: in em units of its frame, and the frame
Fields§
§origin: [f64; 2]where the frame’s origin lies (drawing units) and its map from em units: origin + (m[0] x + m[1] y, m[2] x + m[3] y) (a style in pixels: pixels from the origin, y up, before the camera’s rotation)
m: [f64; 4]§px: bool§glyphs: Vec<Placed>§lines: Vec<Line>§bars: Vec<Bar>§ink: Option<[f64; 4]>the box of the glyphs’ ink (em, in the frame; empty text: None)
cell: [f64; 4]the box of the lines: advances, descender to cap height (em, in the frame)
em: f64the em in drawing units (or pixels): what the zoom decides by
x_height: f64the x-height (em) the bars stand on
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn to_drawing(&self, e: [f64; 2]) -> [f64; 2]
pub fn to_drawing(&self, e: [f64; 2]) -> [f64; 2]
a point of the frame (em) in the drawing (a style in pixels: pixels from the origin)
Sourcepub fn quad_of(&self, b: [f64; 4]) -> [[f64; 2]; 4]
pub fn quad_of(&self, b: [f64; 4]) -> [[f64; 2]; 4]
the corners of a box of the frame in the drawing (counter-clockwise from its lower left in the frame)
Trait Implementations§
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Forget for Layout
impl Freeze for Layoutwhere
*const u8 is !null: Freeze,
PhantomData<Placed>: Freeze,
PhantomData<Line>: Freeze,
PhantomData<Bar>: Freeze,
impl Move for Layout
impl RefUnwindSafe for Layout
impl Send for Layoutwhere
RawVecInner: Send,
impl Sync for Layoutwhere
RawVecInner: Sync,
impl Unpin for Layout
impl UnsafeUnpin for Layoutwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Placed>: UnsafeUnpin,
PhantomData<Line>: UnsafeUnpin,
PhantomData<Bar>: UnsafeUnpin,
impl UnwindSafe for Layoutwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more