Font(filename)

new Font(filename)

Load a '.FNT' file for GRX.
Parameters:
Name Type Description
filename * name of the font file.

Members

static filename

Name of the FNT file.

static maxwidth

Width of widest character

static minwidth

Width of smallest character

Methods

DrawString(x, y, foreground, background, direction, alignX, alignY)

Draw a string to the canvas.
Parameters:
Name Type Description
x number x position
y number y position.
foreground Color foreground color.
background Color background color.
direction number direction from FONT
alignX number alignment from FONT
alignY number alignment from FONT

Resize(w, h)

Resize font to new width / height.
Parameters:
Name Type Description
w number the new width.
h number the new height.

StringHeight(the) → {number}

Calculate string height for this font.
Parameters:
Name Type Description
the string string to check.
Returns:
number - the height in pixels.

StringWidth(the) → {number}

Calculate string width for this font.
Parameters:
Name Type Description
the string string to check.
Returns:
number - the width in pixels.