X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fgraphics%2FFont.java;h=35e9cf27091c030e6fe213b12945d17e26b82e6d;hp=76dfb5e127926d4392284437d83b87338c48d9b4;hb=b0ec2e1d6c3bd35205dfffc6893f01157aef2ced;hpb=9bff7ae2a6824ac83fb1e0ccd455ac3b1277ef3c diff --git a/src/org/ibex/graphics/Font.java b/src/org/ibex/graphics/Font.java index 76dfb5e..35e9cf2 100644 --- a/src/org/ibex/graphics/Font.java +++ b/src/org/ibex/graphics/Font.java @@ -12,12 +12,12 @@ import org.ibex.nestedvm.Runtime; /** encapsulates a single font (a set of Glyphs) */ public class Font { - private Font(Stream stream, int pointsize) { this.stream = stream; this.pointsize = pointsize; } + private Font(JS stream, int pointsize) { this.stream = stream; this.pointsize = pointsize; } private static boolean glyphRenderingTaskIsScheduled = false; public final int pointsize; ///< the size of the font - public final Stream stream; ///< the stream from which this font was loaded + public final JS stream; ///< the stream from which this font was loaded public int max_ascent; ///< the maximum ascent, in pixels public int max_descent; ///< the maximum descent, in pixels boolean latinCharsPreloaded = false; ///< true if a request to preload ASCII 32-127 has begun @@ -46,7 +46,7 @@ public class Font { static final Hashtable glyphsToBeCached = new Hashtable(); static final Hashtable glyphsToBeDisplayed = new Hashtable(); private static Cache fontCache = new Cache(100); - public static Font getFont(Stream stream, int pointsize) { + public static Font getFont(JS stream, int pointsize) { Font ret = (Font)fontCache.get(stream, new Integer(pointsize)); if (ret == null) fontCache.put(stream, new Integer(pointsize), ret = new Font(stream, pointsize)); return ret; @@ -115,7 +115,7 @@ public class Font { // FEATURE: use streams, not memoryfont's // FEATURE: kerning pairs private static final Runtime rt; - private static Stream loadedStream; + private static JS loadedStream; private static int loadedStreamAddr; static { @@ -131,11 +131,11 @@ public class Font { private static void rtCheck() { if(rt.getState() != Runtime.PAUSED) throw new Error("Freetype exited " + rt.exitStatus()); } - private static void loadFontByteStream(Stream res) { + private static void loadFontByteStream(JS res) { if(loadedStream == res) return; try { - Log.info(Font.class, "loading font " + res); + Log.info(Font.class, "loading font " + JS.debugToString(res)); InputStream is = Stream.getInputStream(res); byte[] fontstream = InputStreamToByteArray.convert(is); rt.free(loadedStreamAddr);