X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fgraphics%2FFont.java;h=96c65c4d03d567f8a83a4b7ae6a82001c02ce71b;hb=2d6763644359578428d56d004b998edd10463a84;hp=76dfb5e127926d4392284437d83b87338c48d9b4;hpb=e37e0d13890e41aeb233bf85db1a8e1a376b22e9;p=org.ibex.core.git diff --git a/src/org/ibex/graphics/Font.java b/src/org/ibex/graphics/Font.java index 76dfb5e..96c65c4 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,12 +131,12 @@ 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); - InputStream is = Stream.getInputStream(res); + Log.info(Font.class, "loading font " + JS.debugToString(res)); + InputStream is = res.getInputStream(); byte[] fontstream = InputStreamToByteArray.convert(is); rt.free(loadedStreamAddr); loadedStreamAddr = rt.xmalloc(fontstream.length);