imagepsbbox Syntax array imagepsbboxstring text, int font, int size [, int space [, int character_space [, float angle]]] Description The imagepsbbox function, which was added in P
Trang 1The imagepolygon() function creates a polygon, of color , defined by points and num_points in the image The points parameter is an array containing the polygon's vertices (that is, points[0] = x0, points[1] = y0, points[2] = x1, points[3] = y1, and so on) and num_points is the total number of vertices
imagepsbbox()
Syntax
array imagepsbbox(string text, int font, int size [, int space
[, int character_space [, float angle]]])
Description
The imagepsbbox() function, which was added in PHP 3.0.9, gives the bounding box
of a text rectangle using a PostScript Type 1 font The optional space parameter
enables you to define the size of a space, and character_space enables you to
define the space between characters
Note
Because the box is using information available from character metrics, you might want to specify an angle of 1 for what would normally be 0
The array that is returned contains the items listed in Table 11.21
Table 11.21 Contents of the Returned Array
imagepsencodefont()
Syntax
int imagepsencodefont(string encoding_file)
Description
Trang 2which is often used when you are creating text in a language other than English, you can set the ps.default_encoding directive in the php.ini file to the appropriate encoding font
imagepsfreefont()
Syntax
imagepsfreefont(int font_index)
Description
The imagepsfreefont() function, which was added in PHP 3.0.9, frees any memory (destroys) used by a PostScript Type 1 font
imagepsloadfont()
Syntax
int imagepsloadfont(string font)
Description
The imagepsloadfont() function, which was added in PHP 3.0.9, loads the PostScript Type 1 font If there was an error, it will be returned and printed to you
imagepsextendfont()
Syntax
boolean imagepsextendfont(int font, double extend_or_condense)
Description
The imagepsextendfont() function, which was added in PHP 3.0.9, enables you to extend or condense the font by providing a larger or smaller number in the
extend_or_condense parameter
imagepsslantfont()
Trang 3Syntax
boolean imagepsslantfont(int font, double slant)
Description
The imagepsslantfont() function, which was added in PHP 3.0.9, slant s a
particular font
imagepstext()
Syntax
array imagepstext(int image, string text, int font, int size, int
foreground,
int background, int x, int y [, int space [, int character_space [,
float
angle [, int antialias]]]])
Description
The imagepstext() function, which was added in PHP 3.0.9, draws a text string
over an image using PostScript Type 1 font that is proportioned by size The foreground parameter contains the color you want to use for this text, and the background parameter contains the background color The drawing itself starts at
the specified x and y location
The optional space parameter enables you to define the size of a space, and the character_space enables you to define the space between characters The antialias setting enables you to control the number of colors that will be used to
antialias the text This value can be between 4–16
Note
Because the string is using information available from character metrics, you might want to specify an angle of 1 for what would normally be 0
The array that is returned contains the items listed in Table 11.22
Table 11.22 Contents of the Returned Array
Trang 43 Upper right y-coordinate
imagerectangle()
Syntax
int imagerectangle(int image, int x_1, int y_1, int x_2, int y_2, int color)
Description
The imagerectangle() function draws a rectangle with color in image that starts at x_1 and y_1 and ends at x_2 and y_2
imagesetpixel()
Syntax
int imagesetpixel(int image, int x, int y, int color)
Description
The imagesetpixel() function draws a single pixel with color in image that starts
at x_1 and y_1 and ends at x_2 and y_2
imagestring()
Syntax
int imagestring(int image, int font, int x, int y, string text, int color)
Description
The imagestring() function draws text in image with color in a horizontal manner
It starts at the x and y position defined and is in font
imagestringup()
Trang 5Syntax
int imagestringup(int image, int font, int x, int y, string text, int color)
Description
The imagestringup() function draws text in image with color in a vertical (pointing up) manner It starts at the x and y position defined and is in font
imagesx()
Syntax
int imagesx(int image)
Description
The imagesx() function returns the width of the image
imagesy()
Syntax
int imagesy(int image)
Description
The imagesy() function returns the height of the image
imagettfbbox()
Syntax
array imagettfbbox(int size, int angle, string font, string text)
Description