Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.51 KB

README.md

File metadata and controls

62 lines (43 loc) · 1.51 KB

Usage

Provides some functions for working with and creating ascii art from simple text.


Convert text and symbols into ascii art

fn to_art (input: String, leading: usize, gap: usize, trailing: usize) -> Result<String, String>

To align the art within some space, please use align function with Alignment enum width parameter represents space for your art that will be aligned inside it

fn align(art: &str, alignment: Alignment, width: usize) -> String

Join 2 ascii art images together (they both need to be same width and height rectangle to work, add spaces to the end so it's rectangle)

gap parameter sets number of spaces between arts to be joined

fn join_art (s1: &str, s2: &str, gap: usize) -> String

If you run this crate, it will print ascii symbols with 'small' named font and waits you enter your own string for previewing

movie.mp4

Usage in Rust

use textart::to_art;

fn main () {
  match to_art("Hello in ascii".to_string()) {
      Ok(string) => println!("{}", string),
      Err(err) => println!("Error: {}", err),
  }
}
[dependencies]
text-to-ascii-art="0.1.5"

Road map

  • kindof monospace
  • full monospace
  • add some more special characters
  • auto spacing for join art
  • better documentation