Expand description
____ _ _ _ _____ _____
_____ | _ \| | | | | | ____|_ _| _____
|_____| | |_) | | | | | | _| | | |_____|
|_____| | _ <| |_| | |___| |___ | | |_____|
|_| \_\\___/|_____|_____| |_|
A crate for drawing FIGlets.
The most basic way to use it is as follows:
use rulet::*
let input = "Hello World!";
let figure = figlet::FIGure::from_text(input);
println!("{figure}");
which will print:
_ _ _ _ __ __ _ _ _
| | | | ___| | | ___ \ \ / /__ _ __| | __| | |
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
|_| |_|\___|_|_|\___/ \_/\_/ \___/|_| |_|\__,_(_)
in the default standard
FIGfont. To use another one, you can use FIGfont:
use rulet::*;
let input = "Hello World!";
let font_path = "./small.flf";
let font = FIGfont::from_file(font_path)?;
let figure = FIGure::from_text_with_font(input, &font);
println!("{figure}");
which will use the given FIGfont, in this case, small
:
_ _ _ _ __ __ _ _ _
| || |___| | |___ \ \ / /__ _ _| |__| | |
| __ / -_) | / _ \ \ \/\/ / _ \ '_| / _` |_|
|_||_\___|_|_\___/ \_/\_/\___/_| |_\__,_(_)
You can also load zipped fonts if you enable the zip
crate feature
Re-exports§
pub use figfont::FIGfont;
Structs§
- FIGure
- Represents text written in FIGchars, and can be rendered into a string through the Display trait
- Options
- A struct that holds options for creating a FIGure, when passing it to FIGure::new.