如何写弧形文字?

我想写这样的曲线文字:

弯曲的文本

我怎样才能做到这一点?

Solutions Collecting From Web of "如何写弧形文字?"

大声笑,这很有趣,我只是试图做一个文字曲线,你可以试试看:

package pete.android.study; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; import android.view.View; public class GraphicsView extends View { private static final String MY_TEXT = "xjaphx: Draw Text on Curve"; private Path mArc; private Paint mPaintText; public GraphicsView(Context context) { super(context); mArc = new Path(); RectF oval = new RectF(50,100,200,250);; mArc.addArc(oval, -180, 200); mPaintText = new Paint(Paint.ANTI_ALIAS_FLAG); mPaintText.setStyle(Paint.Style.FILL_AND_STROKE); mPaintText.setColor(Color.WHITE); mPaintText.setTextSize(20f); } @Override protected void onDraw(Canvas canvas) { canvas.drawTextOnPath(MY_TEXT, mArc, 0, 20, mPaintText); invalidate(); } } 

听起来就像你想在path上绘制文本 。 因此,您应该创build一个弧形的path,然后在其上绘制文本,这应该是完美的。 我希望有帮助。