class Font (View source)

Class with Font related methods.

Constants

private CHAR_LISTS

Methods

int
getStringWidth(string $text, string $font, int $fontSize)

Get width of string/text

Details

int getStringWidth(string $text, string $font, int $fontSize)

Get width of string/text

The text element width is calculated depending on font name and font size.

Parameters

string $text

string of which the width will be calculated

string $font

name of the font like Arial,sans-serif etc

int $fontSize

size of font

Return Value

int

width of the text