Server IP : 103.119.228.120 / Your IP : 18.226.17.251 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/share/man/man3/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::Wrap 3" .TH Text::Wrap 3 "2003-02-25" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" GD::Text::Wrap \- Wrap strings in boxes .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use GD; \& use GD::Text::Wrap; \& \& my $gd = GD::Image\->new(800,600); \& # allocate colours, do other things. \& \& my $text = <<EOSTR; \& Lorem ipsum dolor sit amet, consectetuer adipiscing elit, \& sed diam nonummy nibh euismod tincidunt ut laoreet dolore \& magna aliquam erat volutpat. \& EOSTR \& \& my $wrapbox = GDTextWrap\->new( $gd, \& line_space => 4, \& color => $black, \& text => $text, \& ); \& $wrapbox\->set_font(gdMediumBoldFont); \& $wrapbox\->set_font(\*(Aqarial\*(Aq, 12); \& $wrapbox\->set(align => \*(Aqleft\*(Aq, width => 120); \& $wrapbox\->draw(10,140); \& \& $gd\->rectangle($wrap_box\->get_bounds(10,140), $color); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" GD::Text::Wrap provides an object that draws a formatted paragraph of text in a box on a GD::Image canvas, using either a builtin \s-1GD\s0 font or a TrueType font. .SH "METHODS" .IX Header "METHODS" This class doesn't inherit from GD::Text directly, but delegates most of its work to it (in fact to a GD::Text::Align object. That means that most of the GD::Text::Align methods are available for this class, specifically \f(CW\*(C`set_font\*(C'\fR and \f(CW\*(C`font_path\*(C'\fR. Other methods and methods with a different interface are described here: .ie n .SS "GD::Text::Wrap\->new( $gd_object, attribute => value, ... )" .el .SS "GD::Text::Wrap\->new( \f(CW$gd_object\fP, attribute => value, ... )" .IX Subsection "GD::Text::Wrap->new( $gd_object, attribute => value, ... )" Create a new object. The first argument to new has to be a valid GD::Image object. The other arguments will be passed to the \fIset()\fR method for initialisation of the attributes. .ie n .SS "$wrapbox\->set( attribute => value, ... )" .el .SS "\f(CW$wrapbox\fP\->set( attribute => value, ... )" .IX Subsection "$wrapbox->set( attribute => value, ... )" set the value for an attribute. Valid attributes are: .IP "width" 4 .IX Item "width" The width of the box to draw the text in. If unspecified, they will default to the width of the GD::Image object. .IP "line_space" 4 .IX Item "line_space" The number of pixels between lines. Defaults to 2. .IP "para_space, paragraph_space" 4 .IX Item "para_space, paragraph_space" The number of extra pixels between paragraphs, above line_space. Defaults to 0. .IP "color, colour" 4 .IX Item "color, colour" Synonyms. The colour to use when drawing the font. Will be initialised to the last colour in the \s-1GD\s0 object's palette. .IP "align, alignment" 4 .IX Item "align, alignment" Synonyms. One of 'justified' (the default), 'left', 'right' or 'center'. .IP "text" 4 .IX Item "text" The text to draw. This is the only attribute that you absolutely have to set. .IP "preserve_nl" 4 .IX Item "preserve_nl" If set to a true value, newlines in the text will cause a line break. Note that lines will still be justified. If only one word appears on the line, it could get ugly. Defaults to 0. .PP As with the methods, attributes unknown to this class get delegated to the GD::Text::Align class. .ie n .SS "$wrapbox\->get( attribute );" .el .SS "\f(CW$wrapbox\fP\->get( attribute );" .IX Subsection "$wrapbox->get( attribute );" Get the current value of an attribute. All attributes mentioned under the \f(CW\*(C`set()\*(C'\fR method can be retrieved .ie n .SS "$wrapbox\->\fIget_bounds()\fP" .el .SS "\f(CW$wrapbox\fP\->\fIget_bounds()\fP" .IX Subsection "$wrapbox->get_bounds()" Returns the bounding box of the box that will be drawn with the current attribute settings as a list. The values returned are the coordinates of the upper left and lower right corner. .PP .Vb 1 \& ($left, $top, $right, $bottom) = $wrapbox\->get_bounds(); .Ve .PP Returns an empty list on error. .PP \&\s-1NOTE:\s0 The return list of this method may change in a future implementation that allows angled boxes. .ie n .SS "$wrapbox\->draw(x, y)" .el .SS "\f(CW$wrapbox\fP\->draw(x, y)" .IX Subsection "$wrapbox->draw(x, y)" Draw the box, with (x,y) as the top right corner. Returns the same values as the \f(CW\*(C`getbounds()\*(C'\fR method. .PP \&\s-1NOTE:\s0 The return list of this method may change in a future implementation that allows angled boxes. .SH "NOTES" .IX Header "NOTES" As with all Modules for Perl: Please stick to using the interface. If you try to fiddle too much with knowledge of the internals of this module, you may get burned. I may change them at any time. .PP You can only use TrueType fonts with version of \s-1GD \s0> 1.20, and then only if compiled with support for this. If you attempt to do it anyway, you will get errors. .PP Even though this module lives in the GD::Text namespace, it is not a GD::Text. It does however delegate a lot of its functionality to a contained object that is one (GD::Text::Align). .SH "BUGS" .IX Header "BUGS" None that I know of, but that doesn't mean much. There may be some problems with exotic fonts, or locales and character encodings that I am not used to. .SH "TODO" .IX Header "TODO" Angled boxes. .PP At the moment, the only bit of the box that is allowed to be unspecified and in fact must be unspecified, is the bottom. If there is enough need for it, I might implement more flexibility, in that that you need to only specify three of the four sides of the box, and the fourth will be calculated. .PP Automatic resizing of a TrueType font to fit inside a box when four sides are specified, or maybe some other nifty things. .PP More flexibility in the interface. Especially draw needs some thought. .PP More and better error handling. .PP Warnings for lines that are too long and stick out of the box. Warning for emptyish lines? .SH "COPYRIGHT" .IX Header "COPYRIGHT" copyright 1999 Martien Verbruggen (mgjv@comdyn.com.au) .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1GD\s0, GD::Text, GD::Text::Align