// the default leading = 1.5 * size of the font
LwgPhrase phrase3 = new LwgPhrase(
"(3) this is a phrase with a red, normal font Courier, size 20. As you can see the leading is automatically changed.\n",
FontFactory.getFont(FontFactory.COURIER, 20, LwgFont.NORMAL,
new Color(255, 0, 0)));
LwgPhrase phrase4 = new LwgPhrase(new Chunk("(4) this is a phrase\n"));
LwgPhrase phrase5 = new LwgPhrase(
18,
new Chunk(
"(5) this is a phrase in Helvetica, bold, red and size 16 with a given leading of 18 points.\n",
FontFactory.getFont(FontFactory.HELVETICA, 16,
LwgFont.BOLD, new Color(255, 0, 0))));
// A Phrase can contains several chunks with different fonts
LwgPhrase phrase6 = new LwgPhrase("(6)");
Chunk chunk = new Chunk(" This is a font: ");
phrase6.add(chunk);
phrase6.add(new Chunk("Helvetica", FontFactory.getFont(
FontFactory.HELVETICA, 12)));
phrase6.add(chunk);
phrase6.add(new Chunk("Times New Roman", FontFactory.getFont(
FontFactory.TIMES_ROMAN, 12)));
phrase6.add(chunk);
phrase6.add(new Chunk("Courier", FontFactory.getFont(
FontFactory.COURIER, 12)));
phrase6.add(chunk);
phrase6.add(new Chunk("Symbol", FontFactory.getFont(
FontFactory.SYMBOL, 12)));
phrase6.add(chunk);
phrase6.add(new Chunk("ZapfDingBats", FontFactory.getFont(
FontFactory.ZAPFDINGBATS, 12)));
LwgPhrase phrase7 = new LwgPhrase(
"(7) if you don't add a newline yourself, all phrases are glued to eachother!");
document.add(phrase1);