Rotated text
in
Programming Questions
•
1 year ago
I have the following code that's adapted from an online example for rotating text. The code works fine in that it rotates the text to the correct angle, but I would like to know if there is a way to improve the anti-aliasing of the rotated text. On my display it looks as though the rotated text is not anti-aliased despite selecting 'true' when creating the font.
- String message = "abcdefghijklmnopqrstuvwxyz";
- float theta, x;
- void setup() {
- size(800, 200);
- f = createFont("Arial",20,true);
- }
- void draw() {
- // background(255);
- fill(0);
- textFont(f); // Set the font
- translate(x,height/2); // Translate to the center
- rotate(theta); // Rotate by theta
- textAlign(LEFT);
- text(message,0,0);
- theta += 0.1; // Increase rotation
- x += textWidth(message);
- if (x>800){noLoop(); }
- }
1