pub trait RenderText {
// Required methods
fn target_size(self: Pin<&Self>) -> LogicalSize;
fn text(self: Pin<&Self>) -> SharedString;
fn font_request(self: Pin<&Self>, self_rc: &ItemRc) -> FontRequest;
fn color(self: Pin<&Self>) -> Brush;
fn alignment(
self: Pin<&Self>,
) -> (TextHorizontalAlignment, TextVerticalAlignment);
fn wrap(self: Pin<&Self>) -> TextWrap;
fn overflow(self: Pin<&Self>) -> TextOverflow;
fn letter_spacing(self: Pin<&Self>) -> LogicalLength;
fn stroke(self: Pin<&Self>) -> (Brush, LogicalLength, TextStrokeStyle);
// Provided method
fn text_bounding_rect(
self: Pin<&Self>,
self_rc: &ItemRc,
window_adapter: &Rc<dyn WindowAdapter>,
geometry: Rect<f32, LogicalPx>,
) -> Rect<f32, LogicalPx> { ... }
}
Expand description
Trait for an item that represents an Text towards the renderer