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
Text::UnicodeBox::Text(3) User Contributed Perl Documentation Text::UnicodeBox::Text(3)

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.

value
The string representation of the text.
length
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.

  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:

width
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
If the string looks like a number, the align default to 'right'; otherwise, 'left'.
pad (default: 1)
How much padding on the right and left
pad_char (default: ' ')
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()"

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>
2022-04-08 perl v5.32.1

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

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