« Return to Thread: [bug report] - Vertical rotated text missing the last character in PdfPTable

Re: [bug report] - Vertical rotated text missing the last character in PdfPTable

by Bruno Lowagie (iText) :: Rate this Message:

Reply to Author | View in Thread

Gregan, Miroslav wrote:
> Hi all,
>  
> as you can see in the example, I'm using iText 2.1.6.
> I'm trying to write vertical texts without wrapping in a PdfPTable.
> The problem is that the last VAVAVAVAVA's "A" is missing in the rendered
> PDF.
> Maybe it is due to the font's kerning?

No, we're talking about either a complete rewrite of iText; or about
cheating an extra 0.00014111 cm (in 0.0000555 inch).

The problem is that iText calculates the width of a line once like this:

TOTAL - (TOTAL - (a + b + c + d + e))

and once like this:

(a + b + c + d + e)

with a, b, c, d and e widths of glyphs.

Why does iText do it like this? That's historical. PdfLine starts with
the total line width, and gradually subtracts widths of glyphs, till
there's nothing left, or till there's no more space for another glyph.

Later on, we need the width of that line, but only the width that is
left is stored, so we return TOTAL - the width that is left.

However, in another part of the code, the width of a line seems to be
calculate in a more straightforward way.

Due to rounding errors, there's a difference.

At least, that's what I assume. I'm not sure.
That part of the code is eligible for a rewrite, but...
that's probably not going to happen anywhere soon.

br,
Bruno

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

 « Return to Thread: [bug report] - Vertical rotated text missing the last character in PdfPTable