Defined
Write TTF text to the diagram.
Grammar:
Array imagettftext (int im, int size, int angle, int x, int y, int col, string fontfile, string text);
return value:
Array
Function Type:
Graphics processing
PHP function Imagettftext Content Description:
This function writes the TTF (TrueType fonts) font text to the picture. The parameter size is the dimension of the glyph, angle is the angle of the font, clockwise, 0 degrees is the horizontal, that is, the direction of three o'clock (from left to right), 90 degrees from the bottom to the top of the text; x, y two parameter is the coordinate value of the text (the origin is the upper left corner);
The parameter col is the color of the word, the fontfile is the font file name, or the remote file; text is, of course, the string content. The return value is an array of eight elements, the first two are the lower left x, y coordinates, the third to fourth is the bottom right corner of the x, Y coordinates, and the fifth to sixth and 72 or 82 groups are the X, y coordinates of the upper right and upper left respectively. Treat the Rice ⒁ badger neon timid using this function, the system should be fitted with GD and freetype two function libraries.
PHP function Imagettftext Usage Example
This example creates a black basemap with a 400x30 pixel size and writes out I am number one with the arial vector font!! of white-lettering.
- < ? PHP
- Header ("Content-type:image/gif");
- $ im = imagecreate (400,30);
- $ Black = imagecolorallocate ($im,
0,0,0);
- $ White = imagecolorallocate ($im,
255,255,255);
- Imagettftext ($im, 20, 0, 10, 20,
$white, "/somewhere/arial.ttf",
"I am number one!!");
- Imagegif ($im);
- Imagedestroy ($im);
- ?>
http://www.bkjia.com/PHPjc/446059.html www.bkjia.com true http://www.bkjia.com/PHPjc/446059.html techarticle defines the Write TTF text to the diagram. Syntax: array imagettftext (int im, int size, int angle, int x, int y, int col, string fontfile, string text); Return value: Array function type: Graphic ...