Project:Textimage
Version:5.x-2.0-beta
Component:Code
Category:feature request
Priority:normal
Assigned:wundo
Status:closed (fixed)

Issue Summary

The attached patch implements text wrapping support for textimage. Each preset now has a "maximum width" option which can be enforced (when set to non-zero/non-empty). The wrapping algorithm is Unicode-aware and will correctly deal with hyphens and punctuation, as well as words longer than the available space (they are truncated).

Existing presets default to unwrapped.

I also cleaned up that whole ugly defaults assignment code and replaced it with a neat array + assignment loop.

Note: it seems the version in CVS has mixed up line-endings or something, because I can't edit it without causing random extra chunks to show up in the patch. The attached patch is between my versions and the original, but after cleaning up the line-endings.

AttachmentSize
wrapping.patch7.79 KB

Comments

#1

Here's a patch against the current CVS version. The only difference with the one above is that it changes the line endings to be consistent.

AttachmentSize
wrapping-lf.patch 90.97 KB

#2

Sorry, I didn't test backgrounds. The inconsistency in variable naming is a bit annoying there. It now correctly maps ['text']['color'] to $color, but ['background']['color'] to $back_color.

Here is an updated 'differences only' patch.

AttachmentSize
wrapping_0.patch 7.93 KB

#3

Here is an updated patch against current CVS HEAD.

AttachmentSize
wrapping-lf_0.patch 91.15 KB

#4

Assigned to:Anonymous» wundo

As I said to you in PM, I was working in this feature, here is the patch I have (ignoring line endings)...

It's not ready for release yet, but is something ;)

AttachmentSize
wrap_text.patch 2.19 KB

#5

Status:needs review» fixed

commited

#6

Status:fixed» closed (fixed)

#7

Version:5.x-2.x-dev» 5.x-2.0-beta
Status:closed (fixed)» patch (to be ported)

Any plans of committing this to the 5.x branch as well?

#8

Status:patch (to be ported)» closed (fixed)
nobody click here