pub(crate) struct TextRunSegment {
pub font_index: usize,
pub script: Script,
pub bidi_level: Level,
pub range: Range<usize>,
pub break_at_start: bool,
pub runs: Vec<GlyphRun>,
}Fields§
§font_index: usizeThe index of this font in the parent super::InlineFormattingContext’s collection of font
information.
script: ScriptThe Script of this segment.
bidi_level: LevelThe bidi Level of this segment.
range: Range<usize>The range of bytes in the parent super::InlineFormattingContext’s text content.
break_at_start: boolWhether or not the linebreaker said that we should allow a line break at the start of this segment.
runs: Vec<GlyphRun>The shaped runs within this segment.
Implementations§
Source§impl TextRunSegment
impl TextRunSegment
fn new( font_index: usize, script: Script, bidi_level: Level, start_offset: usize, ) -> Self
Sourcefn update_if_compatible(
&mut self,
new_font: &FontRef,
script: Script,
bidi_level: Level,
fonts: &[FontKeyAndMetrics],
font_context: &FontContext,
rendering_group_id: RenderingGroupId,
) -> bool
fn update_if_compatible( &mut self, new_font: &FontRef, script: Script, bidi_level: Level, fonts: &[FontKeyAndMetrics], font_context: &FontContext, rendering_group_id: RenderingGroupId, ) -> bool
Update this segment if the Font and Script are compatible. The update will only ever make the Script specific. Returns true if the new Font and Script are compatible with this segment or false otherwise.
fn layout_into_line_items( &self, text_run: &TextRun, soft_wrap_policy: SegmentStartSoftWrapPolicy, ifc: &mut InlineFormattingContextLayout<'_>, )
fn shape_and_push_range( &mut self, range: &Range<usize>, formatting_context_text: &str, segment_font: &FontRef, options: &ShapingOptions, )
Sourcefn shape_text(
&mut self,
parent_style: &ComputedValues,
formatting_context_text: &str,
linebreaker: &mut LineBreaker,
shaping_options: &ShapingOptions,
font: FontRef,
)
fn shape_text( &mut self, parent_style: &ComputedValues, formatting_context_text: &str, linebreaker: &mut LineBreaker, shaping_options: &ShapingOptions, font: FontRef, )
Shape the text of this TextRunSegment, first finding “words” for the shaper by processing
the linebreaks found in the owning super::InlineFormattingContext. Linebreaks are filtered,
based on the style of the parent inline box.
Trait Implementations§
Source§impl Debug for TextRunSegment
impl Debug for TextRunSegment
Source§impl MallocSizeOf for TextRunSegment
impl MallocSizeOf for TextRunSegment
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for TextRunSegment
impl RefUnwindSafe for TextRunSegment
impl Send for TextRunSegment
impl Sync for TextRunSegment
impl Unpin for TextRunSegment
impl UnwindSafe for TextRunSegment
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
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more