text — Write text to an image
Write a text string to the current image at an optional x,y basepoint position. You can define more details like font-size, font-file and alignment via a callback as the fourth parameter.
The text string that will be written to the image.
x-ordinate defining the basepoint of the first character. Default: 0
y-ordinate defining the basepoint of the first character. Default: 0
Closure callback on the font object to define more optional details. Use the following methods to pass details. See examples of the callback usage below.
Font File
Set path to a True Type Font file or a integer value between 1 and 5 for one of the GD library internal fonts. Default: 1
Font Size
Set font size in pixels. Font sizing is only available if a font file is set and will be ignored otherwise. Default: 12
Font Color
public Intervention\Image\Font color(mixed $color)
Set color of the text in one of the available . Default: #000000
Horizontal Alignment
Set horizontal text alignment relative to given basepoint. Possible values are left, right and center. Default: left
Vertical Alignment
public Intervention\Image\Font valign(string $valign)
Set vertical text alignment relative to given basepoint. Possible values are top, bottom and middle. Default: bottom
Rotation Angle
Set rotation angle of text in degrees. Text will be rotated counter-clockwise around the vertical and horizontal aligned point. Rotation is only available if a font file is set and will be ignored otherwise. Default: no rotation