Text::UnicodeBox::Text - Objects to describe text rendering
This module is part of the low level interface to Text::UnicodeBox; you probably don't need to use it directly.
The string representation of the text.
How many characters wide the text represents when rendered on the screen.
The following methods are exportable by name or by the tag ':all'
Given the passed text, figures out the a smart value for the length field and returns a new instance.
length
my $text = BOX_STRING('Test'); $text->align_and_pad(8); # is the same as # $text->align_and_pad( width => 8, pad => 1, pad_char => ' ', align => 'left' ); $text->value eq ' Test ';
Modify the value of this object to pad and align the text according to the specification. Pass any of the following parameters:
Defaults to the object's length. Specifies how wide of a space the string is to be fit in. Doesn't make sense for this value to smaller then the width of the string. If you pass only one parameter to align_and_pad, this is the parameter it's assigned to.
align_and_pad
If the string looks like a number, the align default to 'right'; otherwise, 'left'.
How much padding on the right and left
What character to use for padding
Returns the value of this object.
Return array of objects of this string split into new strings on the newline character
Provides the count of lines()
lines()
Return the length of the longest line in lines()
my @segments = $obj->split( max_width => 100, break_words => 1 );
Return array of objects of this string split at the max width given. If break_words => 1, break anywhere, otherwise only break on the space character.
Copyright (c) 2012 Eric Waters and Shutterstock Images (http://shutterstock.com). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
Eric Waters <ewaters@gmail.com>
To install Text::UnicodeBox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::UnicodeBox
CPAN shell
perl -MCPAN -e shell install Text::UnicodeBox
For more information on module installation, please visit the detailed CPAN module installation guide.