pub trait RenderString: HasFont {
// Required method
fn text(self: Pin<&Self>) -> PlainOrStyledText;
// Provided methods
fn max_lines(self: Pin<&Self>) -> i32 { ... }
fn line_limit(self: Pin<&Self>) -> Option<usize> { ... }
fn stroke(self: Pin<&Self>) -> (Brush, LogicalLength, TextStrokeStyle) { ... }
fn link_color(self: Pin<&Self>) -> Color { ... }
}Expand description
Trait for an item that represents an string towards the renderer
Required Methods§
fn text(self: Pin<&Self>) -> PlainOrStyledText
Provided Methods§
fn max_lines(self: Pin<&Self>) -> i32
Sourcefn line_limit(self: Pin<&Self>) -> Option<usize>
fn line_limit(self: Pin<&Self>) -> Option<usize>
The maximum number of lines to lay out and render, from the max-lines property.
Property values less than or equal to zero mean no limit.
Sourcefn stroke(self: Pin<&Self>) -> (Brush, LogicalLength, TextStrokeStyle)
fn stroke(self: Pin<&Self>) -> (Brush, LogicalLength, TextStrokeStyle)
Stroke brush, width and style. The style is baked into the shaped glyphs, so it lives
here (rather than in RenderText) to keep measuring and drawing shaping-identical.
Sourcefn link_color(self: Pin<&Self>) -> Color
fn link_color(self: Pin<&Self>) -> Color
Color of Style::Link spans. Like stroke, it’s baked into the shaped glyphs.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".