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 xnumber x position ynumber y position. foregroundColor foreground color. backgroundColor background color. directionnumber direction from FONT alignXnumber alignment from FONT alignYnumber alignment from FONT -
Resize(w, h)
-
Resize font to new width / height.
Parameters:
Name Type Description wnumber the new width. hnumber the new height. -
StringHeight(the) → {number}
-
Calculate string height for this font.
Parameters:
Name Type Description thestring string to check. Returns:
number - the height in pixels. -
StringWidth(the) → {number}
-
Calculate string width for this font.
Parameters:
Name Type Description thestring string to check. Returns:
number - the width in pixels.