pub struct ShapedLine { /* private fields */ }Expand description
A shaped line of text: glyphs, their pen positions, and the run’s metrics.
Implementations§
Source§impl ShapedLine
impl ShapedLine
Sourcepub fn placements(&self) -> &[GlyphPlacement]
pub fn placements(&self) -> &[GlyphPlacement]
The placements, in visual order for a bidi line and logical order otherwise.
Sourcepub fn into_placements(self) -> Vec<GlyphPlacement>
pub fn into_placements(self) -> Vec<GlyphPlacement>
The placements, owned.
Sourcepub fn get(&self, index: usize) -> Option<&GlyphPlacement>
pub fn get(&self, index: usize) -> Option<&GlyphPlacement>
A placement by visual index.
Sourcepub const fn advance_px(&self) -> f32
pub const fn advance_px(&self) -> f32
The total advance width in pixels, kerning included.
Sourcepub const fn descent_px(&self) -> f32
pub const fn descent_px(&self) -> f32
Pixels below the baseline, as a positive number.
Sourcepub const fn line_height_px(&self) -> f32
pub const fn line_height_px(&self) -> f32
The font’s recommended distance between baselines, in pixels.
Sourcepub const fn ink_extent_px(&self) -> Option<(f32, f32)>
pub const fn ink_extent_px(&self) -> Option<(f32, f32)>
The horizontal ink extent, left..right in pixels from the origin, or
None when the line has no ink.
Sourcepub const fn paragraph_level(&self) -> u8
pub const fn paragraph_level(&self) -> u8
The paragraph embedding level.
Sourcepub const fn metrics(&self) -> DeviceMetrics
pub const fn metrics(&self) -> DeviceMetrics
The line’s font metrics.
Sourcepub fn by_cluster(&self) -> Vec<(u32, Vec<&GlyphPlacement>)>
pub fn by_cluster(&self) -> Vec<(u32, Vec<&GlyphPlacement>)>
The placements grouped by cluster, in logical order.
This is the inverse of placements: for a line
whose glyphs were reversed for display, the clusters come back in
reading order, which is what a text-extraction or selection path wants.
Trait Implementations§
Source§impl Clone for ShapedLine
impl Clone for ShapedLine
Source§impl Debug for ShapedLine
impl Debug for ShapedLine
Source§impl Default for ShapedLine
impl Default for ShapedLine
Source§impl PartialEq for ShapedLine
impl PartialEq for ShapedLine
impl StructuralPartialEq for ShapedLine
Auto Trait Implementations§
impl Freeze for ShapedLine
impl RefUnwindSafe for ShapedLine
impl Send for ShapedLine
impl Sync for ShapedLine
impl Unpin for ShapedLine
impl UnsafeUnpin for ShapedLine
impl UnwindSafe for ShapedLine
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