Manual - Font File
Introduction
This class allows you to draw text with a desired font.
Methods
BCGFontFile's Methods
- __constructor__() — Creates the font with the size
- getDimension() — Gets the dimension of the text
-
draw(
$im ,$x ,$y ) — Draws the text on the image
Code Example
// To get an example on how to use this class, check barcode classes.
Method explanations
-
__constructor__()
—
Creates the font with the size
DescriptionCreates the class. The first argument is the path of the .ttf file you want to use. The second argument is the size in point (pt) of the font you want to use.
-
getDimension()
—
Gets the dimension of the text
DescriptionGets the width and height in pixel depending on the font and the entered text.Returns[0] is the width, [1] is the height
-
draw(
$im ,$x ,$y ) — Draws the text on the imageDescription$image is an image resource.
Draws the text at the position$x ,$y .