clean up some font handling

This commit is contained in:
Ben Fry
2014-11-17 18:33:59 -05:00
parent d1e3e357cd
commit 3edd745d20
2 changed files with 22 additions and 34 deletions

View File

@@ -23,10 +23,6 @@
package processing.opengl;
import processing.core.PApplet;
import processing.core.PGraphics;
import java.awt.Font;
import java.io.IOException;
import java.net.URL;
import java.nio.Buffer;
@@ -37,6 +33,10 @@ import java.nio.IntBuffer;
import java.nio.ShortBuffer;
import java.util.Arrays;
import processing.core.PApplet;
import processing.core.PGraphics;
/**
* Processing-OpenGL abstraction layer. Needs to be implemented by subclasses
* using specific OpenGL-Java bindings.
@@ -2105,25 +2105,18 @@ public abstract class PGL {
// TODO: the next three functions shouldn't be here...
// Uses 'Object' so that the API can be used w/ Android Typeface objects
protected int getFontAscent(Font font) {
return 0;
}
abstract protected int getFontAscent(Object font);
protected int getFontDescent(Font font) {
return 0;
}
abstract protected int getFontDescent(Object font);
protected int getTextWidth(Font font, char buffer[], int start, int stop) {
return 0;
}
abstract protected int getTextWidth(Object font, char[] buffer, int start, int stop);
protected Font getDerivedFont(Font font, float size) {
return null;
}
abstract protected Object getDerivedFont(Object font, float size);
///////////////////////////////////////////////////////////