ibex.core updates for new api
[org.ibex.core.git] / src / org / ibex / graphics / Font.java
index 76dfb5e..35e9cf2 100644 (file)
@@ -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);