I'm attaching a patch to add multiline text support to signwriter.

I'm a big fan of the module, but I was running into trouble with long titles on fixed-width columns. Smaller font size is not really an option for me, since it generally looks bad, and really long titles can almost disappear.

This patch substitutes the module's behavior when a max width is set on the profile. When the text width exceeds the max width, the text is broken into as many lines as necessary to render it within the given width.

It works like this: text is exploded in words, that are added one by one to the first line until the max width is reached, at which point a new line is started and the process resumes. After that, lines are rendered to the image one below the other.

It works, but I have not tested extensively.

I'll add a comment to this issue when the site I'm working on is online and you can see this new feature at work.

CommentFileSizeAuthor
signwriter_multiline.diff3.39 KBsolaas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

solaas’s picture

Please delete an unwanted 'drupal_set_message()' on line 546 that made its way on the patch I uploaded. Bad housekeeping.

Wouter Van den Bosch’s picture

I can confirm this works beautifully.

Thanks a lot for sharing your work Solaas ! Was exactly the thing I needed.

solaas’s picture

Thanks, Wouter.

The modified module can now be seen at work at my site: http://solaas.com.ar

Agileware’s picture

Thanks Solaas, this is very useful.

It has been added to the 5.x-1.2 release.

The release also adds a checkbox to the profile settings page where you can toggle multiline on and off. When multiline is off the functionality reverts to the original method of shrinking the text. The default is multiline on.

Agileware’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.