pub struct ShapedBuffer { /* private fields */ }Expand description
A buffer of shaped and positioned glyphs. This is the final output of a text shaping operation.
Implementations§
Source§impl ShapedBuffer
impl ShapedBuffer
Sourcepub fn new(
glyphs: Vec<ShapedGlyph>,
lines: Vec<LineInfo>,
width: f32,
height: f32,
) -> Self
pub fn new( glyphs: Vec<ShapedGlyph>, lines: Vec<LineInfo>, width: f32, height: f32, ) -> Self
Creates a new empty ShapedBuffer.
Sourcepub fn glyphs(&self) -> &[ShapedGlyph]
pub fn glyphs(&self) -> &[ShapedGlyph]
Returns the list of shaped glyphs in this buffer.
Sourcepub fn content_size(&self) -> (f32, f32)
pub fn content_size(&self) -> (f32, f32)
Returns the logical width and height of the text content itself (no padding).
Sourcepub fn outer_size(&self, padding: &Padding) -> (f32, f32)
pub fn outer_size(&self, padding: &Padding) -> (f32, f32)
Returns the visual width and height including the provided padding.
Sourcepub fn size(&self) -> (f32, f32)
pub fn size(&self) -> (f32, f32)
Returns the logical (width, height) used during the last shaping pass.
This is an alias for content_size().
Trait Implementations§
Source§impl Clone for ShapedBuffer
impl Clone for ShapedBuffer
Source§fn clone(&self) -> ShapedBuffer
fn clone(&self) -> ShapedBuffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShapedBuffer
impl Debug for ShapedBuffer
Source§impl Default for ShapedBuffer
impl Default for ShapedBuffer
Source§fn default() -> ShapedBuffer
fn default() -> ShapedBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShapedBuffer
impl RefUnwindSafe for ShapedBuffer
impl Send for ShapedBuffer
impl Sync for ShapedBuffer
impl Unpin for ShapedBuffer
impl UnsafeUnpin for ShapedBuffer
impl UnwindSafe for ShapedBuffer
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