Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textSize() broken in 2.0.3 #2073

Closed
ElectricJack opened this issue Sep 12, 2013 · 5 comments
Closed

textSize() broken in 2.0.3 #2073

ElectricJack opened this issue Sep 12, 2013 · 5 comments
Assignees
Labels

Comments

@ElectricJack
Copy link

screen shot 2013-09-12 at 2 36 44 pm

The horizontal alignment for fonts now appears bound to the initial size of the font, and not the currently active state set by textSize

See the screen shot above and following test code.

PFont fontLarge;

void setup() {
  size(400,400,P3D);
  fontLarge = createFont("Calibri-Bold", 40);
}

void draw() {
  background(255);
  textFont(fontLarge);
  fill(0);
  translate(20,0);
  for( int i=0; i<30; i+=2 ) {
    int size = 40-i;
    textSize(size);
    translate(0, size);
    text("Testing 1 2 3", 0,0);
  }
}
@ElectricJack
Copy link
Author

Guess the workaround at this point is to create the different font sizes required as different font objects...

@benfry
Copy link
Contributor

benfry commented Sep 12, 2013

Updating title to reference P2D and P3D.

@ghost ghost assigned codeanticode Sep 12, 2013
@codeanticode
Copy link
Member

550eaf4 fixes the problem, however in order to get the best looking text in P2D/P3D, my recommendation would be to create a different font object for each size.

@ElectricJack
Copy link
Author

Verified working in 2.1b thanks for the quick fix!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants