Getting Started

The standard usage is:

  • create a paragraph

  • add text to the paragraph

  • change the paragraph context (to change its properties)

  • render the paragraph

  • use the created string, e.g. print it to a console or write it to a file

First, create a paragraph.

AsciiParagraph ap = new AsciiParagraph();

Next, add text. Any text can be added, the renderer will process the text (for instance remove excessive white spaces).

ap.addText("line        1");
ap.addText("2  2");
ap.addText("more text with        tab and \n newline");
ap.addText("some more text to get it over the 80 character default width");

Next, render the paragraph. This will provide the text output using the default settings from the paragraph’s context.

String rend = ap.render();

Finally, print the paragraph to standard out.

System.out.println(rend);

The output will be:

line 1 2 2 more text with tab and newline some more text to get it over  the  80
character default width