[reportlab-users] underlines and horizontal spacing

Henning von Bargen H.vonBargen at t-p.com
Fri Oct 31 04:30:18 EDT 2008

Chris Foster wrote:

> I'm using intra-paragraph markup (<u>...</u>) for underlines and my

> users aren't happy with the line extending into the space between

> words. (It actually looks OK to me, but they're picky.) Is there a

> better way to do underlining or maybe get more spacing between words?

You might try the Paragraph class from wordaxe.rl.NewParagraph
(which will also be used by default as if you say
from wordaxe.rl.Paragraph import Paragraph) from the wordaxe-0.3.0
release (http://deco-cow.sourceforge.net). This implementation
handles spaces explicitly, whereas the reportlab.platypus.Paragraph
implementation only stores the words (not the spaces inbetween).

Using the wordaxe implementation, you can use
Paragraph("<u>Only</u> <u>words</u> <u>are</u> <u>underlined</u>.", style)

This is untested, but should work as expected.

For more spacing between words, you probably have to do some coding,
because the current implementation converts multiple spaces to a single
space. Or you could use a transparent inline image with <img>.

Take a look at Dinu Gherman's alternative paragraph implementation, too.


More information about the reportlab-users mailing list