multi-line text align right: incorrect line breaks and spaces?
in
Programming Questions
•
1 year ago
Hi all,
I'm trying to align a block of text to a right edge, and it looks like the automated line breaks are still put after spaces in the way they are done for textAlign(LEFT), but this ends up giving me an uneven amount of space at the end of each right-aligned line.
Thanks in advance...
- String forecast = "Mostly cloudy in the morning, then partly cloudy. High of 63F. Winds from the ENE at 5 to 15 mph.";
- size(500,500);
- background(0);
- fill(255);
- textFont(createFont("Kievit-Regular",30));
- text(forecast, 50, 20, 400, 200);
- // >>>>>>> DEBUG
- stroke(color(0, 255, 255));
- noFill();
- rect(50, 20, 400, 200);
- noStroke();
- // -------------
- fill(255);
- textAlign(RIGHT);
- text(forecast, 50, 270, 400, 200);
- // >>>>>>> DEBUG
- stroke(color(0, 255, 255));
- noFill();
- rect(50, 270, 400, 200);
- noStroke();
1