Workshop › Tic-tac-toe › Step 8 of 33
Marks are big letters. We set a font, say that the point we give is the middle of the text, and write a pink
X in the middle of the top-left cell, at (50, 50).
```js
ctx.font = 'bold 64px sans-serif'
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
ctx.fillStyle = '#f38ba8'
ctx.fillText('X', 50, 50)
}
```ctx.font sets the font: bold, 64 pixels, a plain sans-serif face.textAlign = 'center' and textBaseline = 'middle' make the given point the middle of the text, so a cell's
center is all we need.fillText('X', 50, 50) writes the text at that point.Inside draw, after the loop's closing } and before the function's last }, leave an empty line and write the
five lines. Press Run.
Skills: Drawing on a canvas
← A function that draws From cell number to position →