Use imagepsslantfont to pitch the font forward or backwards. Sometimes this is
referred to as italics. The font_identifier is an integer returned by imagepsloadfont.
The slant_factor operates similarly to the extension_factor in the
imagepsextendfont function. Values greater than one will cause the top of the font to
pitch to the right. Values less than one will cause the top of the font to pitch to the left.
integer imagepsloadfont(string filename)
Use imagepsloadfont to load a PostScript font. A font identifier will be returned for use
in with the other PostScript functions. If the load fails, FALSE is returned. See
imagepstext, below, for an example.
array imagepstext(integer image, string text, integer
font_identifer, integer size, integer foreground, integer
background, integer x, integer y, integer spacing, integer
letting, double angle, integer antialias_steps)
The imagepstext function draws a string of text into an image using a PostScript font.
The image argument is an integer as returned by imagecreate or imagecreatefrompng.
The font_identifier argument is a value returned by the imagepsloadfont function.
The size argument specifies the height in number of pixels. The foreground and
background arguments are color identifiers. The x and y arguments specify the bottom-
left corner from where to begin drawing. The spacing argument controls vertical spacing
between lines of text. The letting argument controls horizontal spacing between
characters. Both are expressed in units of 1/1000th of an em-square and are added to the
default spacing or leading for a font. They may be positive or negative. The angle
argument specifies a num- ber of degrees to rotate from normal left-to-right orientation.
The antialias_steps argument specifies how many colors to use when antialiasing, or
smoothing. Two values are valid: 4 and 16. The last four arguments are optional.
The returned array contains two pairs of coordinates specifying the lower-left corner and
upper-right corner of the bounding box, respectively.
<?
/
Draw text using a Postscript font
Make the image the correct size
/
//set parameters for text
$font_file = "ComputerModern-Roman";
$size = 20;
$angle = 0;
$text = "PHP";
$antialias_steps = 16;
$spacing = 0;
$letting = 0;