 30; // The width/height of the (Japanese) character is 30px.
    let charHeight = 30;
    let caretLength = 30;

    let editContext = new EditContext();
    canvas.editContext = editContext;

    let anchorX = 0; // the anchor point of the composition
    let anchorY = 0;
    let selection = 0; // selection i.e the index of the caret position

    function renderCaret(x, y) {
        canvasContext2D.beginPath();
        canvasContext2D.moveTo(x + 2, y + 9);
        canvasContext2D.lineTo(x +