Server IP : 103.119.228.120 / Your IP : 3.145.34.51 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/ssl/local/ssl/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 3" .TH Text 3 "2003-06-19" "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 \- Text utilities for use with GD .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use GD; \& use GD::Text; \& \& my $gd_text = GD::Text\->new() or die GD::Text::error(); \& $gd_text\->set_font(\*(Aqfunny.ttf\*(Aq, 12) or die $gd_text\->error; \& $gd_text\->set_font(gdTinyFont); \& $gd_text\->set_font(GD::Font::Tiny); \& ... \& $gd_text\->set_text($string); \& my ($w, $h) = $gd_text\->get(\*(Aqwidth\*(Aq, \*(Aqheight\*(Aq); \& \& if ($gd_text\->is_ttf) \& { \& ... \& } .Ve .PP Or alternatively .PP .Vb 5 \& my $gd_text = GD::Text\->new( \& text => \*(AqSome text\*(Aq, \& font => \*(Aqfunny.ttf\*(Aq, \& ptsize => 14, \& ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a font-independent way of dealing with text in \&\s-1GD,\s0 for use with the GD::Text::* modules and GD::Graph. .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 could 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 If you want to refer to builtin \s-1GD\s0 fonts by their short name (\f(CW\*(C`gdTinyFont\*(C'\fR, \f(CW\*(C`gdGiantFont\*(C'\fR), you will need to \f(CW\*(C`use\*(C'\fR the \s-1GD\s0 module as well as one the GD::Text modules, because it is \s-1GD\s0 that exports those names into your name space. If you don't like that, use the longer alternatives (\f(CW\*(C`GD::Font\-\*(C'\fRGiant>) instead. .SH "METHODS" .IX Header "METHODS" .SS "GD::Text\->new( attrib => value, ... )" .IX Subsection "GD::Text->new( attrib => value, ... )" Create a new object. See the \f(CW\*(C`set()\*(C'\fR method for attributes. .ie n .SS "\fIGD::Text::error()\fP or $gd_text\->\fIerror()\fP;" .el .SS "\fIGD::Text::error()\fP or \f(CW$gd_text\fP\->\fIerror()\fP;" .IX Subsection "GD::Text::error() or $gd_text->error();" Return the last error that occured in the class. This may be imperfect. .ie n .SS "$gd_text\->set_font( font, size )" .el .SS "\f(CW$gd_text\fP\->set_font( font, size )" .IX Subsection "$gd_text->set_font( font, size )" Set the font to use for this string. The arguments are either a \s-1GD\s0 builtin font (like gdSmallFont or GD::Font\->Small) or the name of a TrueType font file and the size of the font to use. See also \&\*(L"font_path\*(R". .PP If you are not using an absolute path to the font file, you can leave of the .ttf file extension, but you have to append it for absolute paths: .PP .Vb 3 \& $gd_text\->set_font(\*(Aqarial\*(Aq, 12); \& # but \& $gd_text\->set_font(\*(Aq/usr/fonts/arial.ttf\*(Aq, 12); .Ve .PP The first argument can be a reference to an array of fonts. The first font from the array that can be found will be used. This allows you to do something like .PP .Vb 3 \& $gd_text\->font_path( \*(Aq/usr/share/fonts:/usr/fonts\*(Aq); \& $gd_text\->set_font( \& [\*(Aqverdana\*(Aq, \*(Aqarial\*(Aq, gdMediumBoldFont], 14); .Ve .PP if you'd prefer verdana to be used, would be satisfied with arial, but if none of that is available just want to make sure you can fall back on something that will be available. .PP Returns true on success, false on error. .ie n .SS "$gd_text\->set_text('some text')" .el .SS "\f(CW$gd_text\fP\->set_text('some text')" .IX Subsection "$gd_text->set_text('some text')" Set the text to operate on. Returns true on success and false on error. .ie n .SS "$gd_text\->set( attrib => value, ... )" .el .SS "\f(CW$gd_text\fP\->set( attrib => value, ... )" .IX Subsection "$gd_text->set( attrib => value, ... )" The set method provides a convenience replacement for the various other \&\f(CW\*(C`set_xxx()\*(C'\fR methods. Valid attributes are: .IP "text" 4 .IX Item "text" The text to operate on, see also \f(CW\*(C`set_text()\*(C'\fR. .IP "font, ptsize" 4 .IX Item "font, ptsize" The font to use and the point size. The point size is only used for TrueType fonts. Also see \f(CW\*(C`set_font()\*(C'\fR. .PP Returns true on success, false on any error, even if it was partially successful. When an error is returned, no guarantees are given about the correctness of the attributes. .ie n .SS "$gd_text\->get( attrib, ... )" .el .SS "\f(CW$gd_text\fP\->get( attrib, ... )" .IX Subsection "$gd_text->get( attrib, ... )" Get the value of an attribute. Return a list of the attribute values in list context, and the value of the first attribute in scalar context. .PP The attributes that can be retrieved are all the ones that can be set, and: .IP "width, height" 4 .IX Item "width, height" The width (height) of the string in pixels .IP "space" 4 .IX Item "space" The width of a space in pixels .IP "char_up, char_down" 4 .IX Item "char_up, char_down" The number of pixels that a character can stick out above and below the baseline. Note that this is only useful for TrueType fonts. For builtins char_up is equal to height, and char_down is always 0. .PP Note that some of these parameters (char_up, char_down and space) are generic font properties, and not necessarily a property of the text that is set. .ie n .SS "$gd_text\->width('string')" .el .SS "\f(CW$gd_text\fP\->width('string')" .IX Subsection "$gd_text->width('string')" Return the length of a string in pixels, without changing the current value of the text. Returns the width of 'string' rendered in the current font and size. On failure, returns undef. .PP The use of this method is vaguely deprecated. .ie n .SS "$gd_text\->is_builtin" .el .SS "\f(CW$gd_text\fP\->is_builtin" .IX Subsection "$gd_text->is_builtin" Returns true if the current object is based on a builtin \s-1GD\s0 font. .ie n .SS "$gd_text\->is_ttf" .el .SS "\f(CW$gd_text\fP\->is_ttf" .IX Subsection "$gd_text->is_ttf" Returns true if the current object is based on a TrueType font. .ie n .SS "$gd_text\->\fIcan_do_ttf()\fP or GD::Text\->\fIcan_do_ttf()\fP" .el .SS "\f(CW$gd_text\fP\->\fIcan_do_ttf()\fP or GD::Text\->\fIcan_do_ttf()\fP" .IX Subsection "$gd_text->can_do_ttf() or GD::Text->can_do_ttf()" Return true if this object can handle \s-1TTF\s0 fonts. .PP This depends on whether your version of \s-1GD\s0 is newer than 1.19 and has \s-1TTF\s0 support compiled into it. .ie n .SS "$gd_text\->font_path(path_spec), GD::Text\->font_path(path_spec)" .el .SS "\f(CW$gd_text\fP\->font_path(path_spec), GD::Text\->font_path(path_spec)" .IX Subsection "$gd_text->font_path(path_spec), GD::Text->font_path(path_spec)" This sets the font path for the \fIclass\fR (i.e. not just for the object). The \f(CW\*(C`set_font\*(C'\fR method will search this path to find the font specified if it is a TrueType font. It should contain a list of paths. The current directory is always searched first, unless '.' is present in \s-1FONT_PATH.\s0 Examples: .PP .Vb 2 \& GD::Text\->font_path(\*(Aq/usr/ttfonts\*(Aq); # Unix \& GD::Text\->font_path(\*(Aqc:/fonts\*(Aq); # MS\-OS .Ve .PP Any font name that is not an absolute path will first be looked for in the current directory, and then in /usr/ttfonts (c:\efonts). .PP .Vb 2 \& GD::Text\->font_path(\*(Aq/usr/ttfonts:.:lib/fonts\*(Aq); # Unix \& GD::Text\->font_path(\*(Aqc:/fonts;.;f:/fonts\*(Aq); # MS\-OS .Ve .PP Any font name that is not an absolute path will first be looked for in /usr/ttfonts (c:\efonts), then in the current directory. and then in lib/fonts (f:\efonts), relative to the current directory. .PP .Vb 1 \& GD::Text\->font_path(undef); .Ve .PP Font files are only looked for in the current directory. .PP \&\s-1FONT_PATH\s0 is initialised at module load time from the environment variables \s-1FONT_PATH\s0 or, if that's not present, \s-1TTF_FONT_PATH,\s0 or \&\s-1TT_FONT_PATH.\s0 .PP Returns the value the font path is set to. If called without arguments \&\f(CW\*(C`font_path\*(C'\fR returns the current font path. .PP Note: This currently only works for unices, and (hopefully) for Microsoft based \s-1OS\s0's. If anyone feels the urge to have a look at the code, and send me patches for their \s-1OS, I\s0'd be most grateful) .SH "BUGS" .IX Header "BUGS" This module has only been tested with anglo-centric 'normal' fonts and encodings. Fonts that have other characteristics may not work well. If that happens, please let me know how to make this work better. .PP The font height gets estimated by building a string with all printable characters (with an ordinal value between 0 and 255) that pass the \&\fIPOSIX::isprint()\fR test (and not the \fIisspace()\fR test). If your system doesn't have \s-1POSIX, I\s0 make an approximation that may be false. Under Perl 5.8.0 the [[:print:]] character class is used, since the \s-1POSIX\s0 is*() functions don't seem to work correctly. .PP The whole font path thing works well on Unix, but probably not very well on other \s-1OS\s0's. This is only a problem if you try to use a font path. If you don't use a font path, there should never be a problem. I will try to expand this in the future, but only if there's a demand for it. Suggestions welcome. .SH "COPYRIGHT" .IX Header "COPYRIGHT" copyright 1999 Martien Verbruggen (mgjv@comdyn.com.au) .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1\fIGD\s0\fR\|(3), \fIGD::Text::Wrap\fR\|(3), \fIGD::Text::Align\fR\|(3) .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 197:" 4 .IX Item "Around line 197:" =pod directives shouldn't be over one line long! Ignoring all 20 lines of content