Font property is used to draw text on a canvas. It defines font properties for text, it has some css values such as style, size etc.
var variableName = canvas.getContext(2d);
variableName.font="fontSize fontStyle";
FillText method is used to fill or insert text on canvas at given position by using co-ordinates (x,y).
var variableName = canvas.getContext(2d);
variableName.fillText("text", x,y);
FillStyle property is used to style text with color.
var variableName = canvas.getContext(2d);
variableName.fillStyle="colorValue";
StrokeText method is used to to draw text on canvas but without fill at given position using co-ordinates (x,y).
var variableName = canvas.getContext(2d);
variableName.strokeText("text", x,y);
StrokeStyle property is used to style text with color. It is used instead of fillStyle property used in fillText method.
var variableName = canvas.getContext(2d);
variableName.strokeStyle="colorValue";
You can draw any text using fillText and strikeText methods.
Open notepad or any other text editor, follow the following points.
save file with name task.html or task.htm and then open it using any browser and see results.