Hi, unfortunately you've run into a bug for which there is no work-around and due to re-organisation building from svn might also not work. If you've got the source for 2.0.8, then you can add the following lines to the com.lowagie.text.rtf.style.RtfFont class and it should work as desired:
/** * The <code>RtfFont</code> is never a standard font. * * @since 2.1.0 */ public boolean isStandardFont() { return false; } /** * Compares this <code>RtfFont</code> to either a [EMAIL PROTECTED] com.lowagie.text.Font} or * an <code>RtfFont</code>. * * @since 2.1.0 */ public int compareTo(Object object) { if (object == null) { return -1; } if(object instanceof RtfFont) { if(this.getFontName().compareTo(((RtfFont) object).getFontName()) != 0) { return 1; } else { return super.compareTo(object); } } else if(object instanceof Font) { return super.compareTo(object); } else { return -3; } } Regards, Mark On Thursday 07 February 2008, Danny Sporea wrote: > I am trying to use Chunks in table cells and generate > an RTF using RtfWriter2. My Chunks each will have a > different font and added to the table cell. However, > only the first font is used for all the chunks. Here > is the code: > > Table tbl = new Table( 2 ); > > RtfCell cell = new RtfCell( new Paragraph( "Task > Type", new RtfFont( "Arial", 11, RtfFont.BOLD, > Color.BLACK ) ) ); > tbl.addCell( cell ); > > cell = new RtfCell(); > cell.add( new Chunk( untickedBox, new RtfFont( > "Arial", 11, RtfFont.NORMAL, Color.BLACK ) ) ); > cell.add( new Chunk( " Planned\t\t", new RtfFont( > "Wingdings", 11, RtfFont.NORMAL, Color.BLACK ) ) ); > cell.add( new Chunk( untickedBox, new RtfFont( > "Arial", 11, RtfFont.NORMAL, Color.BLACK ) ) ); > cell.add( new Chunk( " Unplanned\n", new RtfFont( > "Wingdings", 11, RtfFont.NORMAL, Color.BLACK ) ) ); > tbl.addCell( cell ); > > document.add( tbl ); > > Is this a bug or am I doing something wrong ? If I > don't add the Chunks to the table, but I add them to > the document, I am getting the results I seek... > > Thanks, > Danny > > > > ___________________________________________________________________________ >_________ Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > Buy the iText book: http://itext.ugent.be/itext-in-action/ -- Be free and open and breezy! Enjoy! Things won't get any better so get used to it. My GPG public key is available at: http://www.room3b.eu/data_box/download?path=%2Fsecurity%2FMarkHall.asc
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/