Maybe the descender could be added to the bottom padding. I'll have to think
about it.
Best Regards,
Paulo Soares
----- Original Message -----
From: "Frederik MJ Sauer" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, June 28, 2003 6:36
Subject: Re: [iText-questions] PdfPCell aligning to baseline rather than
bottom of font?
> Paulo,
>
> I understand that your work-around is possible (setting padding
> manuall). I still feel like the functionality ought to be that the text
> by default in raised a bit to fit inside the cell, rather than have
> parts of the text sink through the bottom.
>
> I attached an image of the PDF based on the sample code. Again, looking
> at the "g" in the word "Testing", and the (default) space above the word
>
> "Testing" in the largest font example, I think you can see what I mean.
>
> (This sample is using the 1.00 jar by the way)
>
> Thanks again
> Fred
>
>
> >You can set the padding individually for each border (top, bottom,
> left,
> >right).
> >
> >
> >>While not really noticable at smaller font sizes, it appears that
> >>PdfPCell is placing it's phrase in such a way that roughly the
> baseline
> >>of the bottom is at the bottom of the cell, causing the lower part of
> of
> >>
> >>characters that drop below the line (e.g. pyj,qg) to cross over the
> >>bottom border of the cell. See, for example, the letter "g" in the
> word
> >>"Testing" as the font size increases in this example:
> >>
> >> PdfPTable ptable = new PdfPTable(1);
> >> ptable.getDefaultCell().setBorderColor(Color.RED);
> >> ptable.getDefaultCell().setBorder(Rectangle.BOX);
> >> ptable.getDefaultCell().setBorderWidth(.1f);
> >>
> >> ptable.addCell(new Phrase("Testing",
> >>FontFactory.getFont(FontFactory.COURIER, 7f)));
> >> ptable.addCell(new Phrase("Testing",
> >>FontFactory.getFont(FontFactory.COURIER, 10f)));
> >> ptable.addCell(new Phrase("Testing",
> >>FontFactory.getFont(FontFactory.COURIER, 20f)));
> >> ptable.addCell(new Phrase("Testing",
> >>FontFactory.getFont(FontFactory.COURIER, 30f)));
> >> ptable.addCell(new Phrase("Testing",
> >>FontFactory.getFont(FontFactory.COURIER, 40f)));
> >>
> >> document.add(ptable);
> >>
> >>In examples/Chap0518.java it appears that a small font size and
> >>datatable.getDefaultCell().setPadding(3) are used. Certainly a padding
> >>can be used to prevent the lower part of the letters dropping through
> >>the bottom of the cell, but one must (re)adjust the padding based on
> the
> >>
> >>font size, and as the font size increases, the amount of 'extra'
> padding
> >>
> >>between the top of the phrase and the top border of the cell
> increases.
> >>
> >>
> >>If this is not by design, could you point me to the section of code I
> >>can look at to fix this?
> >>
> >>Keep up the good work, and thanks for the quick responses!
> >>
> >>Fred
> >>
> >
>
>
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions