fn render_text(&self, text: &str, height: i32, single: bool) -> ImageBuffer<Rgba<u8>, Vec<u8>> {
        let (text_width, text_height) = text_size(self.init.scale(), self.init.font(), text);
        // padding for the text up and down
        let height = (height as f32 * if single { 2.5 } else { 1.3 }) as u32;
        let mut image = ImageBuffer::new(text_width as u32, height as u32);
        let y_offset = (image.height() as i32 - text_height) / 2;
        draw_text_mut(
            &mut image,
            Rgba([0_u8, 0_u8, 0_u8, 255_u8]),
            0,
            y_offset,
            self.init.scale(),
            self.init.font(),
            text,
        );
        image
    }
/// Renders a single line of text.
///
/// Returns a transparent [`ImageBuffer`] with one line of caption
/// drawn.  
Renders a single line of text.
Returns a transparent [`ImageBuffer`] with one line of caption
drawn.
Renders a single line of text . Returns a transparent [ ` ImageBuffer ` ] with one line of caption drawn .
fn render_text(&self, text: &str, height: i32, single: bool) -> ImageBuffer<Rgba<u8>, Vec<u8>> {
        let (text_width, text_height) = text_size(self.init.scale(), self.init.font(), text);
        // padding for the text up and down
        let height = (height as f32 * if single { 2.5 } else { 1.3 }) as u32;
        let mut image = ImageBuffer::new(text_width as u32, height as u32);
        let y_offset = (image.height() as i32 - text_height) / 2;
        draw_text_mut(
            &mut image,
            Rgba([0_u8, 0_u8, 0_u8, 255_u8]),
            0,
            y_offset,
            self.init.scale(),
            self.init.font(),
            text,
        );
        image
    }
fn render_text ( & self , text : & str , height : i32 , single : bool ) -> ImageBuffer < Rgba < u8 > , Vec < u8 > > { let ( text_width , text_height ) = text_size ( self . init . scale ( ) , self . init . font ( ) , text ) ; // padding for the text up and down let height = ( height as f32 * if single { 2.5 } else { 1.3 } ) as u32 ; let mut image = ImageBuffer :: new ( text_width as u32 , height as u32 ) ; let y_offset = ( image . height ( ) as i32 - text_height ) / 2 ; draw_text_mut ( & mut image , Rgba ( [ 0_u8 , 0_u8 , 0_u8 , 255_u8 ] ) , 0 , y_offset , self . init . scale ( ) , self . init . font ( ) , text , ) ; image }
Renders a single line of text.
Renders a single line of text .
&self
text
&str
height
i32
single
bool
&self
text
&str
height
i32
single
bool