sogwhite / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

Font ascent and descent in ITextTextRenderer #137

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(moved from https://github.com/flyingsaucerproject/flyingsaucer/issues#issue/7 
reported by https://github.com/rivron)

In the method getFSFontMetrics of ITextTextRenderer (line 55), BaseFont.BBOXURY 
and BaseFont.BBOXLLY are used to calculate the ascent and descent of the font 
while this values are provided by iText.
I propose the following change :
    result.setAscent(bf.getFontDescriptor(BaseFont.ASCENT, size));
    result.setDescent(-bf.getFontDescriptor(BaseFont.DESCENT, size));
With this, the markers of list items are better vertically centered.

Original issue reported on code.google.com by pdoubl...@gmail.com on 26 Mar 2011 at 9:26