开发者

Canvas.drawText Right to Left in Java

How can I output text Right to Left (i.e. in reverse order) using Canvas.drawText ? Is开发者_C百科 there a way?


Set Paint.Align property in your textPaint object, if you set it RIGHT -- The text is drawn to the left of the x,y origin:

textPaint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText("your text here", getRight(), getY()/2, textPaint);


Check this out: How to draw RTL text (Arabic) onto a Bitmap and have it ordered properly?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜