1

I am trying to draw a text on curved path. But when I scale up the canvas, text gets blurred. Here's the code I've tried

public void draw(Canvas canvas) {

    float midX = (maxX + minX) / 2;
    float midY = (maxY + minY) / 2;
    canvas.save();
    canvas.translate(minX, minY);
    canvas.scale(this.scaleX, this.scaleY);
    if (curvingAngle != 0) {
        drawCurveText(canvas, 0f, 0f, 1f);
    } else
        canvas.drawText(text, mOrigin[0], mOrigin[1], textPaint);

    canvas.restore();
}

private void drawCurveText(Canvas canvas,float offsetX, float offsetY, float scale) {
    // Path Calculation
    Path textPath;
    canvas.drawTextOnPath(text, this.textPath, hOffset, 0.0f, this.getPaint());
}

It gives following results

Before Scaleenter image description here After Scaleenter image description here

The same code without curvingAngle (canvas.drawText) works perfectly with scaling. Any help would be appreciated...

Bhupesh
  • 477
  • 1
  • 8
  • 22

0 Answers0