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

Incomplete text rendering of strings with consecutive line breaks #3736

Closed
jwmatthys opened this issue Aug 28, 2015 · 5 comments · Fixed by #3737
Closed

Incomplete text rendering of strings with consecutive line breaks #3736

jwmatthys opened this issue Aug 28, 2015 · 5 comments · Fixed by #3737
Labels
high We'd like to fix this as soon as possible

Comments

@jwmatthys
Copy link

When using the 5-argument version of text(), if there are multiple consecutive line breaks, the text after the line break is not rendered. Minimal example:

void draw() {
  background(0);
  String s = "Hello\n\nWorld.";
  fill(255);
  text(s,10,10,100,100);
}

Output only shows "Hello"

This bug appears to have been introduced after 3.0b3, where the text is rendered correctly.

Tested with Processing 3.0b4 on OSX, Linux, and Windows,, and 3.0b5 on OSX.

@benfry
Copy link
Contributor

benfry commented Aug 28, 2015

Bummer, sounds like a problem introduced by fixing #211 (or #3487). Thanks for the report.

@kasperkamperman
Copy link

The code below still gives a "zero length string passed to TextLayout constructor" error. Removing the textAlign(CENTER, CENTER) solves it or adding a space behind the \n.

In Android mode this code just works normally (discovered it when working with the Ketai library.

void setup() {
  size(800,480);

  textAlign(CENTER, CENTER);
  textSize(48);
}

void draw() {
  background(128);
  text("x: " + nfp(100, 1, 0) + "\n" , 20, 0, width, height);
}

@LotteM
Copy link

LotteM commented Dec 28, 2015

I'm having the same problem in 3.0.1.
Removing the first CENTER solves it..
(but I need my text centered..)

  • I'm not sure if it's best to reopen it, or start another bug report

@benfry
Copy link
Contributor

benfry commented Feb 13, 2016

The original problem was fixed, so open a new report.

@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 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
high We'd like to fix this as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants