In-text whitespaces

The implementation allows to change the default character for white spaces in text. The default is of course a blank ` `. It can be changed to any other character.

The example below sets the in-text white space (called inner white space) to the UTF-8 character ˽ and then to the UTF-8 character .

1
2
3
4
5
6
7
8
9
AsciiParagraph ap = new AsciiParagraph();
ap.getContext().setAlignment(TextAlignment.LEFT).setWidth(35);
ap.addText(new LoremIpsum().getWords(20));

ap.getContext().setInnerWsChar('˽');
System.out.println(ap.render());

ap.getContext().setInnerWsChar('');
System.out.println(ap.render());

The first output has all blanks inside the text replaced with ˽:

Lorem˽ipsum˽dolor˽sit˽amet,
consetetur˽sadipscing˽elitr,˽sed
diam˽nonumy˽eirmod˽tempor˽invidunt
ut˽labore˽et˽dolore˽magna˽aliquyam

The second output has all blanks inside the text replaced with :

Lorem—ipsum—dolor—sit—amet,
consetetur—sadipscing—elitr,—sed
diam—nonumy—eirmod—tempor—invidunt
ut—labore—et—dolore—magna—aliquyam