开发者

Why is it so hard to draw rotated / wrapped text in graphics2D?

开发者 https://www.devze.com 2023-01-23 19:15 出处:网络
I am following up with my question here Drawing wrapped text I see rotating working when I don\'t use the Textlayout but then it does not fit so I need to wrap but the LineBreakMeasurer does not wor

I am following up with my question here Drawing wrapped text

I see rotating working when I don't use the Textlayout but then it does not fit so I need to wrap but the LineBreakMeasurer does not work.

Either I am missing here something completely since it sh开发者_如何学Pythonould not be too hard as I guess


You try work the wrong way around. Don't attempt to rotate the text, instead rotate the drawing surface. Have a look at Graphics2D.rotate(). You can draw anything transformed using normal Graphics2D calls by applying an appropiate transformation to the Graphics2D before.

See the Tutorial for Examples.

0

精彩评论

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