typography
v0.0.6loadFont(path);
Load a font
Arguments
path
The font path on the local systemReturns
font
The image reference function 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
size
The 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
font
The font value returned when using loadFont
textFont(myfont);
text('Hello world!', 100, 200);
text(str, x, y);
Draw text on the screen
Arguments
str
String to renderx
The x position of the start of the texty
The y position of the top of the textFonts are not yet implemented
text('Hello lu5!', 40, 60);