Crate text_art_cn
source ·Expand description
Text to ASCII Art
A text art generator can include any kind of characters depending on the font. The art is composed of Braille characters like ⠐ ⠝ ⠿ ⣫ ⣷ (total 255) Does not support emoji and some strange characters.
Usage:
use text_art_cn::{generate, Options, TextDirect};
let opt = Options {
text: "A".to_string(),
font: "/System/Library/Fonts/PingFang.ttc".to_string(),
..Default::default()
};
let art = generate(opt).unwrap();
println!("{}", art);
// Output:
// ⠀⠀⠀⠀⠀⣠⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⢰⡟⢻⡄⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⢠⡿⠀⠈⢿⡀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⢀⣾⣧⣤⣤⣼⣷⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⣼⠏⠀⠀⠀⠀⠹⣧⠀⠀⠀⠀⠀⠀
// ⠀⠐⠋⠀⠀⠀⠀⠀⠀⠛⠂⠀⠀⠀⠀⠀
//