RenderText

Trait RenderText 

Source
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

Required Methods§

Source

fn target_size(self: Pin<&Self>) -> LogicalSize

Source

fn text(self: Pin<&Self>) -> SharedString

Source

fn font_request(self: Pin<&Self>, self_rc: &ItemRc) -> FontRequest

Source

fn color(self: Pin<&Self>) -> Brush

Source

fn alignment( self: Pin<&Self>, ) -> (TextHorizontalAlignment, TextVerticalAlignment)

Source

fn wrap(self: Pin<&Self>) -> TextWrap

Source

fn overflow(self: Pin<&Self>) -> TextOverflow

Source

fn letter_spacing(self: Pin<&Self>) -> LogicalLength

Source

fn stroke(self: Pin<&Self>) -> (Brush, LogicalLength, TextStrokeStyle)

Provided Methods§

Source

fn text_bounding_rect( self: Pin<&Self>, self_rc: &ItemRc, window_adapter: &Rc<dyn WindowAdapter>, geometry: Rect<f32, LogicalPx>, ) -> Rect<f32, LogicalPx>

Implementors§