Struct cosmic_text::ShapeLine
source · pub struct ShapeLine {
pub rtl: bool,
pub spans: Vec<ShapeSpan>,
}
Expand description
A shaped line (or paragraph)
Fields§
§rtl: bool
§spans: Vec<ShapeSpan>
Implementations§
source§impl ShapeLine
impl ShapeLine
sourcepub fn new(
font_system: &mut FontSystem,
line: &str,
attrs_list: &AttrsList,
shaping: Shaping
) -> Self
pub fn new( font_system: &mut FontSystem, line: &str, attrs_list: &AttrsList, shaping: Shaping ) -> Self
§Panics
Will panic if line
contains more than one paragraph.
sourcepub fn new_in_buffer(
scratch: &mut ShapeBuffer,
font_system: &mut FontSystem,
line: &str,
attrs_list: &AttrsList,
shaping: Shaping
) -> Self
pub fn new_in_buffer( scratch: &mut ShapeBuffer, font_system: &mut FontSystem, line: &str, attrs_list: &AttrsList, shaping: Shaping ) -> Self
Shape a line into a set of spans, using a scratch buffer. If unicode_bidi::BidiInfo
detects multiple paragraphs, they will be joined.
§Panics
Will panic if line
contains multiple paragraphs that do not have matching direction
pub fn layout( &self, font_size: f32, line_width: f32, wrap: Wrap, align: Option<Align>, match_mono_width: Option<f32> ) -> Vec<LayoutLine>
pub fn layout_to_buffer( &self, scratch: &mut ShapeBuffer, font_size: f32, line_width: f32, wrap: Wrap, align: Option<Align>, layout_lines: &mut Vec<LayoutLine>, match_mono_width: Option<f32> )
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ShapeLine
impl Send for ShapeLine
impl Sync for ShapeLine
impl Unpin for ShapeLine
impl UnwindSafe for ShapeLine
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