6 releases (3 breaking)

0.4.0 May 28, 2023
0.3.0 May 19, 2023
0.2.0 May 17, 2023
0.1.2 Apr 30, 2023

#1468 in Text processing

31 downloads per month
Used in seven_seg

GPL-3.0-or-later

32KB
632 lines

txtframe

Display text in a frame.

Displays text within predefined or custom frames. You can set the frame color, change the text alignment.

Examples


use txtframe::*;

let mut text_frame = TextFrame::new()
    .frame_var(&FrameVar::Space)
    .algn(Algn::Centr)
    .color_fra(Color::Red)
    .color_txt(Color::Cyan)
    .color_fill(Color::Magenta)
    .expand(0)
    .width(100)
    .expand_width(0)
    .expand_height(0)
    .left_top('')
    .right_top('')
    .left_btm('')
    .right_btm('')
    .top_line('')
    .vert_left('')
    .vert_right('')
    .btm_line('')
    .fill('');
    
let text_frame_iter = text_frame.frame_iter("Text frame");
println!("{}", text_frame_iter.collect::<String>());

License

GNU General Public License v3.0


lib.rs:

Display text in a frame.

Displays text within predefined or custom frames. You can set the frame color, change the text alignment.

Examples

let mut text_frame = TextFrame::new()
    .frame_var(&FrameVar::Space)
    .algn(Algn::Centr)
    .color_fra(Color::Red)
    .color_txt(Color::Cyan)
    .color_fill(Color::Magenta)
    .expand(0)
    .width(100)
    .expand_width(0)
    .expand_height(0)
    .left_top('')
    .right_top('')
    .left_btm('')
    .right_btm('')
    .top_line('')
    .vert_left('')
    .vert_right('')
    .btm_line('')
    .fill('');

let text_frame_iter = text_frame.frame_iter("Text frame");
println!("{}", text_frame_iter.collect::<String>());

Dependencies

~255–340KB