GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEXT::FLOW::WRAP (3)

.ds Aq ’

NAME

Text::Flow::Wrap - Flexible word wrapping for not just ASCII output.

CONTENTS

SYNOPSIS



  use Text::Flow::Wrap;
 
  # for regular ASCII usage ...
  my $wrapper = Text::Flow::Wrap->new(
      check_width => sub { length($_[0]) < 70 },
  );
 
  # for non-ASCII usage ...
  my $wrapper = Text::Flow::Wrap->new(
      check_width => sub { $pdf->get_text_width($_[0]) < 500 },
  );
 
  my $text = $wrapper->wrap($text);



DESCRIPTION

The main purpose of this module is to provide text wrapping features without being tied down to ASCII based output and fixed-width fonts.

My needs were for sophisticated test control in PDF and GIF output formats in particular.

METHODS

<B>new (%params)B> This constructs a new Text::Flow::Wrap module whose %params set the values of the attributes listed below.
<B>wrap ($text)B> This method will accept a bunch of text, it will then return a new string which is wrapped to the expected width.

    Attribute Accessors

<B>check_width (\&code)B> This attribute is required, and must be a CODE reference. This will be used to determine if the width of the text is appropriate. It will get as an argument, a string which is should check the width of. It should return a Boolean value, true if the string is not exceeded the max width and false if it has.
<B>line_break ($str)B> This is the line break character used when assembling and disassembling the text, it defaults to the newline character \n.
<B>paragraph_boundry ($str)B> This is the paragraph boundry marker used when disassembling the text, it defaults to the string \n.
<B>paragraph_break ($str)B> This is the paragraph breaker used when re-assembling the text, it defaults to the string \n\n.
<B>word_boundry ($str)B> This is the word boundry marker used when disassembling the text, it defaults to a single space character.
<B>word_break ($str)B> This is the paragraph breaker used when re-assembling the text, it defaults to a single space character.

    Paragraph Disassembling

These methods deal with breaking up the paragraphs into its parts, which can then be processed through the re-assembling methods.

These methods are mostly used internally, but more sophisticated tools might need to access them as well (see Text::Flow).
<B>disassemble_paragraphB>
<B>disassemble_paragraphsB>

    Paragraph Reassembling

These methods deal with putting the paragraph parts back together after the disassembling methods have done thier work.

These methods are mostly used internally, but more sophisticated tools might need to access them as well (see Text::Flow)
<B>reassemble_paragraphB>
<B>reassemble_paragraphsB>

    Introspection

<B>metaB> Returns the Moose meta object associated with this class.

BUGS

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Stevan Little <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Copyright 2007 by Infinity Interactive, Inc.

<http://www.iinteractive.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEXT::FLOW::WRAP (3) 2007-05-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.