pub struct TextRasterRequest<'a> {
pub layout: &'a TextLayout,
pub text: StyledTextRef<'a>,
pub rect: Rect,
pub origin: Point,
pub style: &'a TextStyle,
pub fallback_color: Color,
pub scale: f32,
pub ink: GlyphInk,
}Expand description
What to rasterize: layout, the lines of text, its top left corner at
origin and its pixels cut to rect, both in device pixels, scale of
them a layout pixel. Glyphs whose style names no color paint in
fallback_color.
Fields§
§layout: &'a TextLayoutThe lines and glyphs.
text: StyledTextRef<'a>The text and its span styles.
rect: RectThe part of the text the pixels cover.
origin: PointWhere the text’s top left corner sits.
style: &'a TextStyleThe style of the whole text, under its span styles.
fallback_color: ColorThe color of text whose style names none.
scale: f32Device pixels per layout pixel.
ink: GlyphInkWhether the glyphs paint or only their shadows.
Implementations§
Source§impl<'a> TextRasterRequest<'a>
impl<'a> TextRasterRequest<'a>
Sourcepub fn new(
layout: &'a TextLayout,
text: impl Into<StyledTextRef<'a>>,
rect: Rect,
style: &'a TextStyle,
fallback_color: Color,
scale: f32,
) -> Self
pub fn new( layout: &'a TextLayout, text: impl Into<StyledTextRef<'a>>, rect: Rect, style: &'a TextStyle, fallback_color: Color, scale: f32, ) -> Self
layout of text with its top left corner at the corner of rect,
which it covers whole.
Sourcepub fn with_origin(self, origin: Point) -> Self
pub fn with_origin(self, origin: Point) -> Self
The request with the text’s top left corner at origin.
Trait Implementations§
Source§impl<'a> Clone for TextRasterRequest<'a>
impl<'a> Clone for TextRasterRequest<'a>
impl<'a> Copy for TextRasterRequest<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TextRasterRequest<'a>
impl<'a> !UnwindSafe for TextRasterRequest<'a>
impl<'a> Freeze for TextRasterRequest<'a>
impl<'a> Send for TextRasterRequest<'a>
impl<'a> Sync for TextRasterRequest<'a>
impl<'a> Unpin for TextRasterRequest<'a>
impl<'a> UnsafeUnpin for TextRasterRequest<'a>
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