pub struct ShapeLine {
pub rtl: bool,
pub spans: Vec<ShapeSpan>,
pub metrics_opt: Option<Metrics>,
/* private fields */
}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,
direction: Direction,
) -> Self
pub fn new( font_system: &mut FontSystem, line: &str, attrs_list: &AttrsList, shaping: Shaping, tab_width: u16, direction: Direction, ) -> Self
Shape a line into a set of spans, using a scratch buffer.
When unicode_bidi::BidiInfo splits line into multiple paragraphs (on
any BidiClass::B separator, e.g. LF, CR, FS, NEL, PS), the whole line is
laid out in the first paragraph’s base direction.
Sourcepub fn build(
&mut self,
font_system: &mut FontSystem,
line: &str,
attrs_list: &AttrsList,
shaping: Shaping,
tab_width: u16,
direction: Direction,
)
pub fn build( &mut self, font_system: &mut FontSystem, line: &str, attrs_list: &AttrsList, shaping: Shaping, tab_width: u16, direction: Direction, )
See Self::new.
Reuses as much of the pre-existing internal allocations as possible.
pub fn layout( &self, font_size: f32, width_opt: Option<f32>, wrap: Wrap, align: Option<Align>, match_mono_width: Option<f32>, hinting: Hinting, ) -> Vec<LayoutLine>
pub fn layout_to_buffer( &self, scratch: &mut ShapeBuffer, font_size: f32, width_opt: Option<f32>, wrap: Wrap, ellipsize: Ellipsize, align: Option<Align>, layout_lines: &mut Vec<LayoutLine>, match_mono_width: Option<f32>, hinting: Hinting, )
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 UnsafeUnpin 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