 width.
        }
    }

    function render() {
        canvasContext2D.clearRect(0,0, canvas.width, canvas.height);
        
        // rener texts in EditContext's buffer
        canvasContext2D.strokeText(editContext.text, anchorX, anchorY);

        let caretX = anchorX + selection * charWidth;
        let caretY = anchorY;
        renderCaret(caretX, caretY);

        // update layout info through EditContext so IME can show candidate window in the correct position.
        let controlB