Examples of RtfFont


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

       
        if(this.listLevel == 0) {
            correctIndentation();
        }
       
        fontNumber = new RtfFont(document, new Font(Font.TIMES_ROMAN, 10, Font.NORMAL, new Color(0, 0, 0)));
        if (list.getSymbol() != null && list.getSymbol().getFont() != null && !list.getSymbol().getContent().startsWith("-") && list.getSymbol().getContent().length() > 0) {
            // only set this to bullet symbol is not default
            this.fontBullet = new RtfFont(document, list.getSymbol().getFont());
            this.bulletCharacter = list.getSymbol().getContent().substring(0, 1);
        } else {
            this.fontBullet = new RtfFont(document, new Font(Font.SYMBOL, 10, Font.NORMAL, new Color(0, 0, 0)));
        }       
    }
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.spacingBefore() * RtfElement.TWIPS_FACTOR));
            this.paragraphStyle.setSpacingAfter((int) (paragraph.spacingAfter() * 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++) {
            Element chunk = (Element) 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 {
                chunks.add(doc.getMapper().mapElement(chunk));
View Full Code Here

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

            this.lineLeading = (int) (phrase.getLeading() * RtfElement.TWIPS_FACTOR);
        } else {
            this.lineLeading = 0;
        }
       
        RtfFont phraseFont = new RtfFont(null, phrase.getFont());
        for(int i = 0; i < phrase.size(); i++) {
            Element chunk = (Element) phrase.get(i);
            if(chunk instanceof Chunk) {
                ((Chunk) chunk).setFont(phraseFont.difference(((Chunk) chunk).getFont()));
            }
            try {
                chunks.add(doc.getMapper().mapElement(chunk));
            } catch(DocumentException de) {
            }
View Full Code Here

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

            this.superSubScript = ((Float)chunk.getAttributes().get(Chunk.SUBSUPSCRIPT)).floatValue();
        }
        if(chunk.getAttributes() != null && chunk.getAttributes().get(Chunk.BACKGROUND) != null) {
            this.background = new RtfColor(this.document, (Color) ((Object[]) chunk.getAttributes().get(Chunk.BACKGROUND))[0]);
        }
        font = new RtfFont(doc, chunk.getFont());
        content = chunk.getContent();
    }
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 void 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)));
  }
View Full Code Here

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

                    if(rtfElement instanceof RtfList) {
                        ((RtfList) rtfElement).setParentList(this);
                    } else if(rtfElement instanceof RtfListItem) {
                        ((RtfListItem) rtfElement).setParent(ll);
                    }
                    ll.setFontNumber( new RtfFont(document, new Font(Font.TIMES_ROMAN, 10, Font.NORMAL, new Color(0, 0, 0))) );
                    if (list.getSymbol() != null && list.getSymbol().getFont() != null && !list.getSymbol().getContent().startsWith("-") && list.getSymbol().getContent().length() > 0) {
                        // only set this to bullet symbol is not default
                        ll.setBulletFont( list.getSymbol().getFont());
                        ll.setBulletCharacter(list.getSymbol().getContent().substring(0, 1));
                    } else
View Full Code Here

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

            Document document = new Document();
            RtfWriter2.getInstance(document, new FileOutputStream("ExtendedFont.rtf"));
            document.open();
           
            // Create a RtfFont with the desired font name.
            RtfFont msComicSans = new RtfFont("Comic Sans MS");
           
            // Use the RtfFont like any other Font.
            document.add(new Paragraph("This paragraph uses the" +
                    " Comic Sans MS font.", msComicSans));
           
            // Font size, font style and font colour can also be specified.
            RtfFont bigBoldGreenArial = new RtfFont("Arial", 36, Font.BOLD, Color.GREEN);
           
            document.add(new Paragraph("This is a really big bold green Arial text", bigBoldGreenArial));
            document.close();
        } catch (FileNotFoundException fnfe) {
            fnfe.printStackTrace();
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(Element.ALIGN_RIGHT);
            doc.add(p);
View Full Code Here

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

            Document document = new Document();
            RtfWriter2.getInstance(document, new FileOutputStream("ExtendedFontStyles.rtf"));
            document.open();
           
            // Use the RtfFont.STYLE_* instead of the Font styles.
            RtfFont doubleStrikethrough = new RtfFont("Arial", RtfFont.UNDEFINED,
                    RtfFont.STYLE_DOUBLE_STRIKETHROUGH);
            RtfFont shadow = new RtfFont("Arial", RtfFont.UNDEFINED,
                    RtfFont.STYLE_SHADOW);
           
            // Or combine them with Font styles.
            RtfFont engravedItalic = new RtfFont("Arial", RtfFont.UNDEFINED,
                    RtfFont.STYLE_ENGRAVED | Font.ITALIC);
           
            // The hidden style is special since it hides text.
            RtfFont hidden = new RtfFont("Arial", RtfFont.UNDEFINED,
                    RtfFont.STYLE_HIDDEN);
           
            Paragraph paragraph = new Paragraph("This text is ", new RtfFont("Arial", 12));
           
            // Use the RtfFonts when creating the text.
            paragraph.add(new Chunk("deleted,", doubleStrikethrough));
            paragraph.add(new Chunk(" shady,", shadow));
            paragraph.add(new Chunk(" engraved and italic", engravedItalic));
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.