[reportlab-users] Paragraph height wrong when using xml font tags
Henning von Bargen
H.vonBargen at t-p.com
Tue Jun 23 07:12:43 EDT 2009
> From: Volker Haas <volker.haas at brainbot.com>
> Subject: Paragraph height wrong when using xml font tags
>
> Hi all.
>
> The height of a paragraph flowable is not calculated correctly when
> using xml font tags to change the font size. This only happens if *all*
> of the text in the paragraph flowable is inside a font tag which
> changes the size.
>
> i.e.
> * Paragraph('<font size=30>text</font>', someStyle)
> has an *incorrect* height
> adding some "plain" text fixes this:
> * Paragraph('<font size=30>text</font> X', someStyle)
> has the correct height
>
> Obviously it would make more sense in the first example to change
> the line height of the paragraph style but this is not feasible
> for my use case.
>
> The effect of the wrong height calculation is that consecutive
> paragraphs overlap.
>
> See the attached minimal example for details. I tested this with the
> current trunk version of reportlab.
>
> It would be great if this could be fixed.
>
> Thanks,
> Volker
-1 from me:
Using different font sizes inside a paragraph is considered
bad typographic style AFAIK.
If you really have to use different font sizes, then
you should adjust the leading accordingly to prevent overlapping.
If RL did adjust the height calculation automatically
it would result in an unsteady layout, because the base lines
wouldn't be equidistant any more.
Henning
More information about the reportlab-users
mailing list