typography

v0.0.6
loadFont(path);

Load a font

Arguments

pathThe font path on the local system

Returns

fontThe 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

sizeThe size of the font in pixels

If 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 loadFont

 textFont(myfont);
 text('Hello world!', 100, 200);

text(str, x, y);

Draw text on the screen

Arguments

strString to render
xThe x position of the start of the text
yThe y position of the top of the text

Fonts are not yet implemented

 text('Hello lu5!', 40, 60);