function printText(text, positionX, positionY, alignment = 'left', baseline = 'alphabetic', style = 'normal', weight = 'normal', size = '10', font = 'Arial', colour = '#000'){ // Save the styling, and content already on the canvas ctx.save(); // Do the alterations and print the text context.textAlign = alignment; context.textBaseline = baseline; // Set the font styling ctx.font = style+' '+weight+' '+size+'pt'+' '+font; //ctx.font-style = fontStyle; // normal, italic, oblique ctx.fillStyle = colour; // Actually add the text ctx.fillText(text, positionX, positionY); // Restore the prior existing canvas content ctx.restore(); }