diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 971f255e5..720ff3e17 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -4708,10 +4708,11 @@ public class PGraphics extends PImage implements PConstants { // boundary of a word or end of this sentence if ((buffer[index] == ' ') || (index == stop)) { // System.out.println((index == stop) + " " + wordStart + " " + index); - if (start != stop && wordStart == index) { // end of line, nothing is fitting - return false; + float wordWidth = 0; + if (index > wordStart) { + // we have a non-empty word, measure it + wordWidth = textWidthImpl(buffer, wordStart, index); } - float wordWidth = textWidthImpl(buffer, wordStart, index); if (runningX + wordWidth >= boxWidth) { if (runningX != 0) {