loadFont(path);Load a font
Arguments
pathThe font path on the local systemReturns
fontThe image referencefunction setup()
createWindow(600, 600);
font = loadFont('/path/to/myfont.ttf');
end
function draw()
background(51);
textFont(font);
text('Hello from lu5!', 30, 50);
end textSize(size);Set the font size
Arguments
sizeThe size of the font in pixelsIf this is called using fonts, make sure to call textSize after calling textFont
textSize(56);
text('Big Text', 50, 50);textFont(font);Set the font family
Arguments
fontThe font value returned when using loadFonttextFont(myfont);
text('Hello world!', 100, 200);text(str, x, y);Draw text on the screen
Arguments
strString to renderxThe x position of the start of the textyThe y position of the top of the textFonts are not yet implemented
text('Hello lu5!', 40, 60);