I have text which, when in portrait orientation, runs along the bottom of 
the screen. When the orientation is switched to landscape I want to draw the 
same text vertically along the same edge of the screen, so that it appears 
in exactly the same place as when in portrait mode. Other ui elements are 
drawn as normal for the new orientation. 

I have tried:

Path path = new Path();
path.moveTo(getWidth() - textGap, getHeight());
path.lineTo(getWidth() - textGap, 0);
canvas.drawTextOnPath(textString, path, 0, 0, paint);

and

canvas.save();
canvas.rotate(270);
canvas.drawText(textString, -getHeight() / 2, getWidth() - textGap, paint);
canvas.restore();

this works best, but bits and pieces of letters are still up to several 
pixels out from their origional position, as if the width of certain the 
letters changed. 

Even drawing the text onto a seperate canvas, rotated and drawn onto the 
current one doesnt seem to work as that forcibly applies antialiasing for 
some reason. That is even worse because the text is very small at 12 points 
and is better without it - the size of the text may or may not be a factor 
in my problem, though I would have thought a straight up 90 degree rotate 
would produce a perfect result regardless.

-Numeron

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to