Bug 1309 : textAlign(JUSTIFY)
Last modified: 2010-06-05 11:47




Status:
ASSIGNED
Resolution:
-
Priority:
P2
Severity:
enhancement

 

Reporter:
antiplastik
Assigned To:
fry

Attachment Type Created Size Actions
new constant in PConstant application/octet-stream 2009-08-24 09:44 13.89 KB
new functions in PGraphics application/octet-stream 2009-08-24 09:46 138.57 KB

Description:   Opened: 2009-08-24 09:42
Add a new align property (JUSTIFY) which allow text justification.
Additional Comment #1 From antiplastik 2009-08-24 09:44
edit]
new constant in PConstant
Additional Comment #2 From fry 2009-08-24 09:46
Eww, justified text is ugly. ;-)
Additional Comment #3 From antiplastik 2009-08-24 09:46
edit]
new functions in PGraphics

I had to add new functions so I can pass the boxWidth argument to the
textLineImpl() method.
Additional Comment #4 From fry 2009-08-24 09:47
Oh wow, an actual implementation. I'll take a look.
Additional Comment #5 From antiplastik 2009-08-24 09:49
// example

String str = "This text should wrap properly and should be pixel-perfect
justified.";
textFont(createFont("", 12), 12);
size(200, 100);
background(255); fill(0);
textAlign(JUSTIFY);
text(str, 20, 20, width-40, height-40);
noFill();
rect(20, 20, width-40, height-40);
Additional Comment #6 From antiplastik 2009-08-24 09:51
> Eww, justified text is ugly. ;-)

Aha! But the worse is... my code is ugly too! :-D

This bug is now being tracked here.