Example usage for com.lowagie.text Chunk font

List of usage examples for com.lowagie.text Chunk font

Introduction

In this page you can find the example usage for com.lowagie.text Chunk font.

Prototype

Font font

To view the source code for com.lowagie.text Chunk font.

Click Source Link

Document

This is the Font of this chunk of text.

Usage

From source file:org.areasy.common.doclet.Doclet.java

License:Open Source License

/**
 * Processes one Java package of the whole API.
 *
 * @param packageDoc The javadoc information for the package.
 * @throws Exception/* w  ww.  ja v  a2s.c  om*/
 */
private void printPackage(PackageDoc packageDoc, ClassDoc[] packageClasses) throws Exception {
    State.setCurrentPackage(packageDoc.name());
    State.setCurrentDoc(packageDoc);

    Document.newPage();

    String packageName = State.getCurrentPackage();

    // Text "package"
    State.setCurrentClass("");

    Paragraph label = new Paragraph((float) 22.0, LB_PACKAGE, Fonts.getFont(TEXT_FONT, BOLD, 18));
    Document.add(label);

    Paragraph titlePara = new Paragraph((float) 30.0, "");
    // Name of the package (large font)
    Chunk titleChunk = new Chunk(packageName, Fonts.getFont(TEXT_FONT, BOLD, 30));
    titleChunk.setLocalDestination(packageName);
    if (State.getCurrentFile() != null) {
        String packageAnchor = Destinations.createAnchorDestination(State.getCurrentFile(), null);
        titlePara.add(PDFUtility.createAnchor(packageAnchor, titleChunk.font()));
    }

    titlePara.add(titleChunk);
    Document.add(titlePara);

    // Some empty space
    Document.add(new Paragraph((float) 20.0, " "));

    State.setContinued(true);

    String packageText = DocletUtility.getComment(packageDoc);
    Element[] objs = HtmlParserWrapper.createPdfObjects(packageText);

    if (objs.length == 0) {
        String packageDesc = DocletUtility.stripLineFeeds(packageText);
        Document.add(new Paragraph((float) 11.0, packageDesc, Fonts.getFont(TEXT_FONT, 10)));
    } else
        PDFUtility.printPdfElements(objs);

    State.setContinued(false);

    State.increasePackageSection();

    printClasses(DocletUtility.sort(packageClasses), packageDoc);
}

From source file:org.areasy.common.doclet.document.tags.TagA.java

License:Open Source License

protected Chunk createChunk(String text) {
    Chunk chunk = new Chunk(text);

    Font font = chunk.font();
    font.setStyle(Font.NORMAL);//from  ww  w  . j av  a2 s  .co  m
    font.setColor(Color.blue);

    chunk.setFont(font);

    return chunk;
}