Examples of RtfFont


Examples of com.lowagie.text.rtf.style.RtfFont

     * @param font The Font this RtfField should use
     */
    protected RtfField(RtfDocument doc, LwgFont font) {
        super("", font);
        this.document = doc;
        this.font = new RtfFont(this.document, font);
    }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

    /**
     * Override setFont to perform the correct font handling.
     */
    public void setFont(LwgFont font) {
        super.setFont(font);
        this.font = new RtfFont(this.document, font);
    }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

     *
     * @param fontNr The original font number.
     * @param fontName The font name to look up.
     */
    public boolean importFont(String fontNr, String fontName) {
        RtfFont rtfFont = new RtfFont(fontName);
        rtfFont.setRtfDocument(this.rtfDoc);
        this.importFontMapping.put(fontNr, Integer.toString(this.rtfDoc.getDocumentHeader().getFontNumber(rtfFont)));
        return true;
    }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

     * @param fontNr The original font number.
     * @param fontName The font name to look up.
     * @param charset The character set to use for the font.
     */
    public boolean importFont(String fontNr, String fontName, int charset) {
        RtfFont rtfFont = new RtfFont(fontName);
        if(charset>= 0)
            rtfFont.setCharset(charset);
            rtfFont.setRtfDocument(this.rtfDoc);
            this.importFontMapping.put(fontNr, Integer.toString(this.rtfDoc.getDocumentHeader().getFontNumber(rtfFont)));
            return true;
    }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

     * @param fontNr The original font number.
     * @param fontName The font name to look up.
     * @param charset The character set to use for the font.
     */
    public boolean importFont(String fontNr, String fontName, String fontFamily, int charset) {
        RtfFont rtfFont = new RtfFont(fontName);

        if(charset>= 0)
            rtfFont.setCharset(charset);
        if(fontFamily != null && fontFamily.length() > 0)
            rtfFont.setFamily(fontFamily);
        rtfFont.setRtfDocument(this.rtfDoc);
        this.importFontMapping.put(fontNr, Integer.toString(this.rtfDoc.getDocumentHeader().getFontNumber(rtfFont)));
        return true;
    }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

   
  public RtfListLevel(RtfDocument doc)
  {
    super(doc);
    templateID = document.getRandomInt();
        setFontNumber( new RtfFont(document, new LwgFont(LwgFont.TIMES_ROMAN, 10, LwgFont.NORMAL, new Color(0, 0, 0))));
        setBulletFont(new LwgFont(LwgFont.SYMBOL, 10, LwgFont.NORMAL, new Color(0, 0, 0)));
  }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

  public RtfListLevel(RtfDocument doc, RtfList parent)
  {
    super(doc);
    this.parent = parent;
    templateID = document.getRandomInt();
    setFontNumber( new RtfFont(document, new LwgFont(LwgFont.TIMES_ROMAN, 10, LwgFont.NORMAL, new Color(0, 0, 0))));
        setBulletFont(new LwgFont(LwgFont.SYMBOL, 10, LwgFont.NORMAL, new Color(0, 0, 0)));
  }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

  /**
   * set the bullet font
   * @param f
   */
  public void setBulletFont(LwgFont f) {
    this.fontBullet = new RtfFont(document, f);
  }
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

     * @param doc The RtfDocument this RtfParagraph belongs to
     * @param paragraph The Paragraph that this RtfParagraph is based on
     */
    public RtfParagraph(RtfDocument doc, Paragraph paragraph) {
        super(doc);
        RtfFont baseFont = null;
        if(paragraph.getFont() instanceof RtfParagraphStyle) {
            this.paragraphStyle = this.document.getDocumentHeader().getRtfParagraphStyle(((RtfParagraphStyle) paragraph.getFont()).getStyleName());
            baseFont = this.paragraphStyle;
        } else {
            baseFont = new RtfFont(this.document, paragraph.getFont());
            this.paragraphStyle = new RtfParagraphStyle(this.document, this.document.getDocumentHeader().getRtfParagraphStyle("Normal"));
            this.paragraphStyle.setAlignment(paragraph.getAlignment());
            this.paragraphStyle.setFirstLineIndent((int) (paragraph.getFirstLineIndent() * RtfElement.TWIPS_FACTOR));
            this.paragraphStyle.setIndentLeft((int) (paragraph.getIndentationLeft() * RtfElement.TWIPS_FACTOR));
            this.paragraphStyle.setIndentRight((int) (paragraph.getIndentationRight() * RtfElement.TWIPS_FACTOR));
            this.paragraphStyle.setSpacingBefore((int) (paragraph.getSpacingBefore() * RtfElement.TWIPS_FACTOR));
            this.paragraphStyle.setSpacingAfter((int) (paragraph.getSpacingAfter() * RtfElement.TWIPS_FACTOR));
            if(paragraph.hasLeading()) {
                this.paragraphStyle.setLineLeading((int) (paragraph.getLeading() * RtfElement.TWIPS_FACTOR));
            }
            this.paragraphStyle.setKeepTogether(paragraph.getKeepTogether());
        }       
        for(int i = 0; i < paragraph.size(); i++) {
            LwgElement chunk = (LwgElement) paragraph.get(i);
            if(chunk instanceof Chunk) {
                ((Chunk) chunk).setFont(baseFont.difference(((Chunk) chunk).getFont()));
            } else if(chunk instanceof RtfImage) {
                ((RtfImage) chunks.get(i)).setAlignment(this.paragraphStyle.getAlignment());
            }
            try {
                RtfBasicElement[] rtfElements = doc.getMapper().mapElement(chunk);
View Full Code Here

Examples of com.lowagie.text.rtf.style.RtfFont

            Paragraph p = new Paragraph();
            p.add(new RtfTableOfContents("UPDATE ME!"));
            doc.add(p);

            p = new Paragraph("", new RtfFont("Staccato222 BT"));
            p.add(new Chunk("Hello! "));
            p.add(new Chunk("How do you do?"));
            doc.add(p);
            p.setAlignment(LwgElement.ALIGN_RIGHT);
            doc.add(p);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.