----- Original Message ----- From: "Eric Summkeller" <[EMAIL PROTECTED]> To: <itext-questions@lists.sourceforge.net> Sent: Friday, March 14, 2008 8:11 AM Subject: Re: [iText-questions] Problem with the Background of a Chunk object!
> Bruno Lowagie <bruno <at> lowagie.com> writes: > >> iText already does this for you: >> >> float fontSize = chunk.font().size(); >> float ascender = >> chunk.font().getFont().getFontDescriptor(BaseFont.ASCENT, fontSize); >> float descender = >> chunk.font().getFont().getFontDescriptor(BaseFont.DESCENT, fontSize); >> >> The font provides the values for ASCENT and DESCENT. >> If you want to fine tune this, you'll have to dig into >> the font and hope the metrics you need are available. >> >> br, >> Bruno >> > > Sorry, but your code example doesn't work because at a Font object, there > is > no method getFont and the method getFontDescriptor is not available. Can > you > tell me what's wrong? > float ascender = chunk.font().getCalculatedBaseFont(false).getFontDescriptor(BaseFont.ASCENT, fontSize); Paulo ------------------------------------------------------------------------- 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/