unicode-line-stacker 1.0.0

Tiny library for stacking Unicode line-drawing characters on top of each other.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented4 out of 4 items with examples
  • Size
  • Source code size: 6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.08 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • axesilo/unicode-line-stacker
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • axesilo

Unicode Line Stacker

What is this crate?

Suppose you are drawing "lines" in the terminal using box-drawing characters and are filling in a 2-D grid of chars.

You might first put down a ┌ but then later want to draw a ┴ on top of that. This crate will calculate that the resulting char should be a ┼.

You can also convert a 4-bit bit string into a line drawing character.

Usage

let combo = unicode_line_stacker::stack('', '');
assert_eq!(Some(''), combo);

// Bit string format: for each of the four directions, clockwise starting from
// top (least significant to most significant), 1 means "on" and 0 means "off."
let c = unicode_line_stacker::bits_to_char(0b1011);
assert_eq!('', c);

Current Functionality

Right now the crate only supports the "light" line drawing characters in the four cardinal directions.