diff --git a/core/src/processing/core/PGraphicsJava2D.java b/core/src/processing/core/PGraphicsJava2D.java index df5d2e725..4b43c7e90 100644 --- a/core/src/processing/core/PGraphicsJava2D.java +++ b/core/src/processing/core/PGraphicsJava2D.java @@ -1582,7 +1582,7 @@ public class PGraphicsJava2D extends PGraphics { @Override public float textDescent() { if (textFont == null) { - defaultFontOrDeath("textAscent"); + defaultFontOrDeath("textDescent"); } Font font = (Font) textFont.getNative(); //if (font != null && (textFont.isStream() || hints[ENABLE_NATIVE_FONTS])) { @@ -1621,7 +1621,7 @@ public class PGraphicsJava2D extends PGraphics { @Override public void textSize(float size) { if (textFont == null) { - defaultFontOrDeath("textAscent", size); + defaultFontOrDeath("textSize", size); } // if a native version available, derive this font @@ -1668,6 +1668,10 @@ public class PGraphicsJava2D extends PGraphics { @Override protected float textWidthImpl(char buffer[], int start, int stop) { + if (textFont == null) { + defaultFontOrDeath("textWidth"); + } + Font font = (Font) textFont.getNative(); //if (font != null && (textFont.isStream() || hints[ENABLE_NATIVE_FONTS])) { if (font != null) {