pub struct ShapeLine {
pub rtl: bool,
pub spans: Vec<ShapeSpan>,
pub metrics_opt: Option<Metrics>,
}
Expand description
A shaped line (or paragraph)
Fields§
§rtl: bool
§spans: Vec<ShapeSpan>
§metrics_opt: Option<Metrics>
Implementations§
Source§impl ShapeLine
impl ShapeLine
Sourcepub fn new(
font_system: &mut FontSystem,
line: &str,
attrs_list: &AttrsList,
shaping: Shaping,
tab_width: u16,
) -> Self
pub fn new( font_system: &mut FontSystem, line: &str, attrs_list: &AttrsList, shaping: Shaping, tab_width: u16, ) -> 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
Sourcepub fn build(
&mut self,
font_system: &mut FontSystem,
line: &str,
attrs_list: &AttrsList,
shaping: Shaping,
tab_width: u16,
)
pub fn build( &mut self, font_system: &mut FontSystem, line: &str, attrs_list: &AttrsList, shaping: Shaping, tab_width: u16, )
pub fn layout( &self, font_size: f32, width_opt: Option<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, width_opt: Option<f32>, wrap: Wrap, align: Option<Align>, layout_lines: &mut Vec<LayoutLine>, match_mono_width: Option<f32>, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShapeLine
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