If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

textFont(font, size*)

Using textFont() with createFont(), it's possible to change the font of text drawn.

createFont(name, size)

Parameters:
NameDescription
nameA font name, either "sans-serif", "serif", "monospace", "fantasy", or "cursive"
size(Optional) The size of the font, in pixels

textFont(font, size)

Parameters:
NameDescription
fontA font returned by the createFont() function
size(Optional) The size of the font, in pixels

Want to join the conversation?

No posts yet.