-none- 2007-09-11 - By mister bean
Back
That will always happen when font-size = leading-size. Font size does not refer to the maximum height of the characters.
For this reason, leading is generally 1.2x - 1.5x font size. Change the leading accordingly, and the problem should go away.
---mr. bean
>> re >>>
Eric Summkeller wrote: > > I create one paragraph with a font size of 40 and one paragraph with a > font > size of 10. The leading of each paragraph is its font size. My problem is, > that the first paragraph overwrites the text of the second paragraph. > Any ideas what I could do to resolve this problem? > > Example: > Phrase phrase1 = new Phrase("_Test",FontFactory.getFont(FontFactory.TIMES, > 40, > Font.NORMAL,new Color(255, 0, 0))); > > Paragraph p1 = new Paragraph("", phrase1.getFont()); > p1.setLeading(phrase1.getFont().getSize()); > > Phrase phrase2 = new Phrase("_Test",FontFactory.getFont(FontFactory.TIMES, > 10, > Font.NORMAL,new Color(255, 0, 0))); > > Paragraph p2 = new Paragraph("", phrase2.getFont()); > p2.setLeading(phrase2.getFont().getSize()); > > p1.add(phrase1); > p2.add(phrase2); > > document.add(p1); > document.add(p2); > > > >
-- View this message in context: http://www.nabble.com/Problem-with-the-leading-of -a-Paragraph-tf4420120.html#a12608615 Sent from the iText - General mailing list archive at Nabble.com.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|