[reportlab-users] Paragraph height wrong when using xml font tags
Robin Becker
robin at reportlab.com
Tue Jun 23 09:30:39 EDT 2009
.......
>
> But the problem here is with a paragraph with a single font size.
>
I said earlier that I thought this must relate to the use of a single tag
encompassing the whole of the paragraph. That means there are no style changes
internally so I think it gets handled by a so called 'fast path'. There must be
some difference in the way things are handled for the fast versus the slow path.
The implication is that
'<font color=red>this is red</font>' will get a different treatment to '<font
color=red>this is </font><font color=red>red</font>' because there are two
fragments in the latter so it goes through the general (slow) path.
In the fast path case we appear to have assumed that the single fragment styling
will have come from the supplied style rather than as in this case to have been
supplied in the text of the paragraph. In this particular corner case we need
either to force things into the slow path or to change the way the height is
calculated in wrap and other places where we rely on the style rather than the
actual fragments.
--
Robin Becker
More information about the reportlab-users
mailing list