 let thickWidth = 3;
        let thinWidth = 2;

        // Japanese IME returns 'Squiggle' while Chinese returns 'Dotted' for active composition.
        // For simplicity we draw dotted line for both.
        if (style == 'Squiggle' || style == 'Dotted') {
            canvasContext2D.setLineDash([1, 1]); // dotted line pattern
            canvasContext2D.beginPath();
            canvasContext2D.moveTo(lineStartX,lineY);
            canvasContext2D.lineTo(lineEndX, lineY);
            canvasConte