setFont

Sets the font to use for when drawing text onto this Image.

If the font name is not found, then the browser will automatically default back to the system font.

Note that different browsers, and operating systems, will each render the font differently.

.setFont( name, size )

Sets the font to use when drawing text onto this Image. 'font' should be the name of the font, whilst 'size' refers to it's height in pixels.

.setFont( name, size ) { ... }

The block version of setFont. This will only alter the font for the lifetime of the block, and set it back to the previous font when the block returns.

.setFont( name, size, style )

Sets the font to use, but also allows you to specify a style.

Styles should be supplied as a string which includes all of the styles to use. This currently only allows 'bold', 'italic', or 'bold italic'.

.setFont( name, size, style ) { ... }

The same as the previous setFont, only this localizes the change to just the block.

See also

drawText - fillText