Home Contents | # gcx:font | Graphics | Core4 Lua Commands

## SYNOPSIS

1. gcx:font(newfont)
2. fnt = gcx:font()

## DESCRIPTION

If specified, newfont makes the graphics context gcx use it as the font for drawing text.
With no arguments, returns the font currently used by gcx.

## RETURN VALUE

The font handle which is currently used by gcx.

## ERRORS

Raises an error if gcx is not a graphics context or if newfont is not a font handle.

## EXAMPLE

>
gcx:font(gfx.default_font())

## SEE ALSO

fnt:close, fnt:first_char, fnt:last_char, fnt:name, fnt:ascent, fnt:descent, fnt:height, fnt:lbearing, fnt:maxwidth, fnt:minwidth, fnt:rbearing, fnt:width, gfx.default_font, gfx.font, tostring(font)