Description
This crate provides a data structure for text alignment. Rectangular Panes, which may have smaller child Panes, can be defined, and the positions of characters of text within them can be calculated.
The graphics feature, which is on by default, allows the direct rendering of a Pane with the piston2d-graphics crate.
Example
The following example creates a simple Pane tree where some nodes contain formatted text. The Pane is then drawn using my graphics_buffer crate, and the image is saved to a file.
extern crate graphics_buffer;
extern crate pane;
use *;
use *;
static ROBOTO: &'static = include_bytes!;
static MESSAGE1: &'static str =
"Somebody once told me the world is gonna role me. I ain't the sharpest tool in the shed.";
static MESSAGE2: &'static str = "She was lookin' kinda dumb with her finger and her thumb";
static MESSAGE3: &'static str = "in the shape of an 'L' on her forehead.";
This example creates the image below. Notice the different text justifications.
