[][src]Trait embedded_text::style::height_mode::HeightMode

pub trait HeightMode: Copy {
    pub fn apply<C, F, A, V, H>(text_box: &mut StyledTextBox<'_, C, F, A, V, H>)
    where
        C: PixelColor,
        F: Font + Copy,
        A: HorizontalTextAlignment,
        V: VerticalTextAlignment,
        H: HeightMode
;
pub fn calculate_displayed_row_range<F: Font>(
        cursor: &Cursor<F>
    ) -> Range<i32>; }

Specifies how the TextBox's height is adjusted when it is turned into a StyledTextBox.

Required methods

pub fn apply<C, F, A, V, H>(text_box: &mut StyledTextBox<'_, C, F, A, V, H>) where
    C: PixelColor,
    F: Font + Copy,
    A: HorizontalTextAlignment,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

Apply the height mode to the textbox

Note: This function is used by TextBox::into_styled and normally does not need to be called manually.

pub fn calculate_displayed_row_range<F: Font>(cursor: &Cursor<F>) -> Range<i32>[src]

Calculate the range of rows of the current line that can be drawn.

If a line does not fully fit in the bounding box, some HeightMode options allow drawing partial lines. For a partial line, this function calculates, which rows of each character should be displayed.

Loading content...

Implementors

impl HeightMode for FitToText[src]

impl<OV> HeightMode for Exact<OV> where
    OV: VerticalOverdraw
[src]

impl<OV> HeightMode for ShrinkToText<OV> where
    OV: VerticalOverdraw
[src]

Loading content...