text_art_cn/lib.rs
1//! # Text to ASCII Art
2//!
3//! A text art generator can include any kind of characters depending on the font. The art is composed of Braille characters like ⠐ ⠝ ⠿ ⣫ ⣷ (total 255)
4//! Does not support emoji and some strange characters.
5//!
6//! ## Usage:
7//! ```rust
8//! use text_art_cn::{generate, Options, TextDirect};
9//!
10//! let opt = Options {
11//! text: "A".to_string(),
12//! font: "/System/Library/Fonts/PingFang.ttc".to_string(),
13//! ..Default::default()
14//! };
15//! let art = generate(opt).unwrap();
16//! println!("{}", art);
17//! // Output:
18//! // ⠀⠀⠀⠀⠀⣠⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀
19//! // ⠀⠀⠀⠀⢰⡟⢻⡄⠀⠀⠀⠀⠀⠀⠀⠀
20//! // ⠀⠀⠀⢠⡿⠀⠈⢿⡀⠀⠀⠀⠀⠀⠀⠀
21//! // ⠀⠀⢀⣾⣧⣤⣤⣼⣷⠀⠀⠀⠀⠀⠀⠀
22//! // ⠀⠀⣼⠏⠀⠀⠀⠀⠹⣧⠀⠀⠀⠀⠀⠀
23//! // ⠀⠐⠋⠀⠀⠀⠀⠀⠀⠛⠂⠀⠀⠀⠀⠀
24//! //
25//! ```
26//!
27//!
28
29pub use options::Options;
30pub use options::TextDirect;
31pub use generate::generate;
32
33mod generate;
34mod char_map;
35mod flat_to_chunk;
36mod convert_char_to_bitmap;
37mod options;