homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author parent5446
Recipients parent5446
Date 2011年07月04日.02:12:58
SpamBayes Score 1.8032364e-10
Marked as misclassified No
Message-id <1309745581.79.0.51605072509.issue12485@psf.upfronthosting.co.za>
In-reply-to
Content
Python's textwrap module can be helpful at times, but personally I think there are a couple of things that could be added.
First, when it comes to text wrapping, usually you're not dealing with a monospace font where each letter is the same size. If you're working with the Python Imaging Library for example, there is a function that you pass the text to in order to determine how wide (or tall) a font is. Therefore, it would be useful to have a parameter where the user can pass a function that gives a custom width for a set of text. The default for this parameter, of course, would be len.
Also, this module uses a rough and efficient algorithm for wrapping text, but the results are not always aesthetically pleasing (one word hanging off on a line). Sometimes the user may want something that is wrapped more beautifully, so to say, such as is found in TeX. So there should also be a beautiful option that goes back and redistributes the text so that it is more aesthetically pleasing.
This isn't exactly that important (minor improvements to a module that is probably not used much), but I figured I'd get it out there as I run into the problem all the time when trying to wrap text to be put in images of a set size.
History
Date User Action Args
2011年07月04日 02:13:02parent5446setrecipients: + parent5446
2011年07月04日 02:13:01parent5446setmessageid: <1309745581.79.0.51605072509.issue12485@psf.upfronthosting.co.za>
2011年07月04日 02:13:01parent5446linkissue12485 messages
2011年07月04日 02:13:00parent5446create

AltStyle によって変換されたページ (->オリジナル) /