diff --git a/android/core/src/processing/core/PFont.java b/android/core/src/processing/core/PFont.java index df263f683..7e71bed25 100644 --- a/android/core/src/processing/core/PFont.java +++ b/android/core/src/processing/core/PFont.java @@ -438,7 +438,7 @@ public class PFont implements PConstants { /** * Return the native Typeface object associated with this PFont (if any). */ - public Typeface getNative() { + public Object getNative() { if (subsetting) { return null; } diff --git a/android/core/src/processing/core/PGraphicsAndroid2D.java b/android/core/src/processing/core/PGraphicsAndroid2D.java index 3c006b545..3f36cbcba 100644 --- a/android/core/src/processing/core/PGraphicsAndroid2D.java +++ b/android/core/src/processing/core/PGraphicsAndroid2D.java @@ -1112,7 +1112,7 @@ public class PGraphicsAndroid2D extends PGraphics { @Override public void textFont(PFont which) { super.textFont(which); - fillPaint.setTypeface(which.getNative()); + fillPaint.setTypeface((Typeface) which.getNative()); } @@ -1143,7 +1143,7 @@ public class PGraphicsAndroid2D extends PGraphics { defaultFontOrDeath("textSize", size); } - Typeface font = textFont.getNative(); + Typeface font = (Typeface) textFont.getNative(); if (font != null) { fillPaint.setTextSize(size); } @@ -1176,7 +1176,7 @@ public class PGraphicsAndroid2D extends PGraphics { @Override protected float textWidthImpl(char buffer[], int start, int stop) { // Font font = textFont.getFont(); - Typeface font = textFont.getNative(); + Typeface font = (Typeface) textFont.getNative(); if (font == null) { return super.textWidthImpl(buffer, start, stop); } @@ -1209,7 +1209,7 @@ public class PGraphicsAndroid2D extends PGraphics { @Override protected void textLineImpl(char buffer[], int start, int stop, float x, float y) { - Typeface font = textFont.getNative(); + Typeface font = (Typeface) textFont.getNative(); if (font == null) { showWarning("Inefficient font rendering: use createFont() with a TTF/OTF instead of loadFont()."); //new Exception().printStackTrace(System.out);