Manual - Font


This class allows you to draw text with a desired font.


BCGfont's Methods

Code Example

// To get an example on how to use this class, check barcode classes.

Method explanations

  • __constructor__(font, size) — Creates the font with the size
    Creates 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
    Gets the width and height in pixel depending on the font and the entered text.
    [0] is the width, [1] is the height
  • draw(im, x, y) — Draws the text on the image
    image is an image resource.
    Draws the text at the position x, y.