pub struct ShapedRun {Show 16 fields
pub font_id: u16,
pub size: f32,
pub text: String,
pub source: String,
pub source_map: Vec<u32>,
pub text_start: u32,
pub origin: Option<SourceRange>,
pub pseudo_element: Option<NodeId>,
pub inline: Option<NodeId>,
pub lead: f32,
pub trail: f32,
pub features: Features,
pub color: Color,
pub decoration: TextDecoration,
pub glyphs: Vec<ShapedGlyph>,
pub advance: u32,
}Expand description
A run of glyphs sharing one font and size — the paintable unit.
Fields§
§font_id: u16Index into the registry that shaped the run.
size: f32Em size in points.
text: StringThe text the run was shaped from. Glyph ids alone do not spell anything, and the correspondence exists only in the shaper’s output.
source: StringWhat the author wrote, where a transform made that differ from what was shaped, and empty where the two are the same.
source_map: Vec<u32>The offset in source of every byte boundary of text.
Empty alongside source.
text_start: u32Byte offset of text in the paragraph the glyphs’ clusters
index.
origin: Option<SourceRange>Where the run was written: the node it was shaped from and
the bytes of that node’s own text it stands for. None for
text no node was walked for: page furniture, an ornament.
pseudo_element: Option<NodeId>The pseudo-element the run was cut from, where it was cut from one.
inline: Option<NodeId>The innermost inline element the run came from: a link, an
emphasis, a strong, a code span. None on the text of the
paragraph itself.
lead: f32Points of space before the run’s first glyph, from the leading edges of the inline boxes that open on it.
trail: f32Points of space after its last glyph, from the trailing edges of the ones that close on it.
features: FeaturesThe features the run was shaped with.
color: ColorWhat the run is painted in.
decoration: TextDecorationWhat is drawn across it: the rules text-decoration asks
for, each painted over the run’s own advance.
glyphs: Vec<ShapedGlyph>The glyphs, in visual order.
advance: u32Total advance of the run’s glyphs, in font units. What an
inline box takes beside them is lead and trail, in points.
Implementations§
Trait Implementations§
impl StructuralPartialEq for ShapedRun
Auto Trait Implementations§
impl Freeze for ShapedRun
impl RefUnwindSafe for ShapedRun
impl Send for ShapedRun
impl Sync for ShapedRun
impl Unpin for ShapedRun
impl UnsafeUnpin for ShapedRun
impl UnwindSafe for ShapedRun
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.